You are currently viewing AWS 101: What is Amazon EC2?

AWS 101: What is Amazon EC2?

Virtual servers are a core component of Cloud infrastructure. Amazon EC2s are the heart of many applications on the AWS Cloud, with entire applications or enterprises built on top of this service. Unlike hosting on-premise, with the Cloud you no longer need to purchase and maintain a pre-defined set of hardware which is able to cope with varying levels of traffic and usage. EC2s remove the restrictions and compromises of physical compute capacity as they can scale to the demand of the application, meaning that you pay only for the resources you use.

At Cloud Elemental, we work closely with our clients to create, maintain, and secure their EC2s – ensuring that best practices are met to keep costs down, maintain high availability, and uphold security whilst aligning with your business requirements.

What is Amazon EC2?

Amazon EC2 (also known as the Elastic Compute Cloud) is a service that provides secure, resizable virtual servers in the Cloud. In simpler terms, it’s a remote computer (called an instance) that you can effectively rent from Amazon Web Services (AWS) to run an application, or perform any other computing tasks.

It is extremely flexible (elastic, even!), allowing you to customise the size, type, and configurations to fit your needs. It is highly scalable, allowing you to adjust computing capacity to the demand and use of the server, which leads to it being very cost-effective. You only pay for the computing time that you use.

How to set-up an Amazon EC2 Instance

With EC2, you can spin up (create) a virtual server in minutes. AWS provides a range of instance types that offer different combinations of CPU, memory, storage, and networking capacity.

When you create an EC2 instance, you’re essentially choosing:

  • Instance Type: This defines the hardware configuration (e.g., general-purpose, compute-optimised).
  • Operating System (OS): You can select from popular OS options like Linux, Windows, and more.
  • Region: You choose the geographic location where your EC2 instance will run. AWS has data centres worldwide.

Once you define the where and what of your EC2, you can specify further configurations such as Security Groups for inbound and outbound traffic rules; storage options, such as Elastic Block Store (persistent storage) or Instance Storage (temporary storage while instance is running); key-pair management for secure access to the instance; monitoring such as CloudWatch or Billing Alerts to track the metrics and statistics of the EC2.

Once an EC2 has been created, you can then log on and start installing all the software that you need for your application. 

How do you Scale an EC2?

You now have a fully set-up instance running – but what if we needed a copy? Would we need to start this process again from scratch? No need!

The settings and configurations of an EC2 can be preserved in multiple ways, namely: Amazon Machine Images (AMIs), Launch Templates, and AWS Backup.

At this point, you will have one fully functional EC2 for your application needs. If the traffic on this server is high the application may slow down. Auto-Scaling is an EC2 feature which helps mitigate this, as it can spin up and tear down instances as needed to divide the traffic between them. You specify the minimum and maximum number of instances to better control costs.

But how does it know what configurations to spin up? Would we have to go through all these steps again to create a new server? Not to worry! AWS provides multiple ways for an EC2’s configurations to be preserved, with Amazon Machine Images (AMIs) or Launch Templates.

AMIs are images that contain the software configuration (OS, installed software, and custom settings) required to launch an EC2 instance. Launch Templates are a reusable set of configuration parameters for launching EC2 instances. These define a wider range of configuration settings used to spin up the EC2, such as the instance type, security groups, and can build using an AMI as a base. Launch Templates integrate with Auto-Scaling groups to deploy multiple instances in a standardised way.

How do you pay for an EC2 Instance?

The flexibility of EC2 doesn’t stop at the configurations – there are several payment options to choose from based on your usage needs.

  1.  On-Demand Instances: This follows the pay-as-you-go model found across AWS, meaning you only pay for the compute capacity used. This makes it an ideal option for short-term, unpredictable or experimental workloads.
  2. Savings Plan: Requiring commitment to consistent usage (measured in $/hour) for 1 or 3 year term, a Savings Plan offers a discount of up to 72% for EC2s. It offers flexibility as it allows you to change configurations and automatically benefit from the Saving Plan price – such as instance family, size, region, and so on.
  3. Reserved Instances: AWS recommends Saving Plans over Reserved Instances as they’re typically more flexible. Requiring an upfront payment and commitment of 1 or 3 years, reserved instances can provide a significant discount compared to on-demand pricing, making it the best  choice for applications with predictable, ongoing usage.
  4. Spot Instances: These instances are unused EC2 capacity which you can rent at a heavily discounted rate (up to 90% off On-Demand prices). This comes with the caveat that AWS can request the instance back with very short notice, so it is ideal for flexible, fault-tolerant workloads.

GET IN TOUCH

Kannen Joshi

Consultant & DevOps Engineer

GET IN TOUCH

Kannen Joshi

Consultant & DevOps Engineer

Leave a Reply