Co-Author: Sushant Paudyal

Amazon Elastic Compute Cloud (Amazon EC2)

Amazon EC2 is a compute service provided by AWS which provides virtual resizable machines that help you operate and manage your resources in a specified throughput. This is one of the first and most popular AWS services used by architects and developers to perform tasks on high-end virtual computers. This service was designed to remove the need of on-premise servers for computations, as it is cost effective as well because it follows the pay-as-you-go pricing model. One can use Amazon EC2 to host applications through EC2 instances as application servers, database servers, file servers, game servers, web servers and more. With these instances, you can have full administrative control over those resources. 

 

EC2 Instances:

Instances are the virtual machines that you set up to work on with your resources. With Amazon EC2, you can launch any number of instances of any size into any Availability Zone in the world in a matter of minutes. For example, if you want to manage your business database workloads, you can create an EC2 instance for the database server, configuring the computing features such as storage options, security groups, instance type, networking, operating system, and so on.

Now, let’s discuss some key features under Amazon EC2: 

1. Cost and capacity optimization:

  • Pay-as-you-go-pricing: While using this service, you only pay for what resources are being used for what time. You are not charged for resources that are unused and remain idle like on-premise resources.
  • Scale resources using EC2 Auto-Scaling: Amazon EC2 Auto-Scaling allows you to automatically scale your Amazon EC2 capacity up or down according to conditions you define. You can add or remove the EC2 instances using EC2 policies. EC2 auto scaling automatically manages your instances and resources such that your usage is optimized with no additional resources staying idle. This plays a huge role in pricing as well because your resources will be automatically adjusted for how much it is needed to perform and complete the task so that you don’t pay for the unused resources. 
  • Pause and resume instances: If your EC2 instance is backed by Amazon Elastic Block Store (Amazon EBS), you can temporarily hibernate your resources which are not in use and restart them when you need. Hibernating resources persist the data from instance’s memory (RAM) into an EBS root volume, and once it is restarted again, it reloads the RAM contents back to the previous state.

2. Storage:

  • Optimal storage as specified for every workload: While configuring your EC2 instance type, you have the options to choose the storage volumes and types to run your resources. For example, you can allocate things like RAM, CPU, Memory while creating the EC2 instance according to your workload. AWS also offers different services like Amazon Elastic Block Store (Amazon EBS), Amazon Elastic File System (Amazon EFS) and Amazon Simple Storage Service (Amazon S3) to set up resources according to your needs and requirements.

3. Operating systems and software:

Amazon Machine Images (AMI) are pre-configured with a lot of operating systems that you can choose from, which include Microsoft Windows, Linux, Ubuntu, Debian and so on. You can choose appropriate AMIs through the following:

  • Quick start: These are the pre-built AMIs like Linux and Windows OSs.
  • My AMIs: These are the AMIs that the user created.
  • AWS Marketplace: This is a digital catalog that lists thousands of software solutions to help you in your specified use cases. 
  • Community AMIs: They are the software solutions built by architects and developers around the world but as they are not checked by AWS, use them at your own risk.

Now, lets see the pricings for Amazon EC2 services:

AWS EC2 Pricing:

Free tier: AWS Free Tier includes 750 hours of Lixnux and Windows t2.micro instances, (t3.micro for the regions in which t2.micro is unavailable) each month for one year. Use only EC2 Micro instances to stay within the Free Tier service.

  1. On-demand instances: This offers low cost and flexibility over your resources in your instance for running short- term and unpredictable workloads and applications that are being developed and tested on Amazon EC2 for the first time. The outbound cost in data transfer differs according to geographical region. Also, the hourly rate for on-demand instances is different depending on the type of instance. For detailed pricing, visit the AWS official website by clicking here.
  2. Spot instances: This is used by developers with urgent computing needs for large scale and dynamic workload. These instances provide elasticity in scaling as well. For detailed pricing, visit the AWS official website by clicking here.
  3. Reserved instances: This instance is used for predictable compute needs. As we know, the pay-as-you-go model works best when you don’t know what amount of resources you need for what time, so you are only charged for what you use, but reserved instances are used when you are certain about your plans on using the resources. So here you pay first and then start using the resources, which ultimately becomes a cheaper option as well. For detailed pricing, visit the AWS official website by clicking here. 
  4. Dedicated hosts: Dedicated host is a physical EC2 server dedicated for your use. They are the servers fully dedicated for your use, so you can help address corporate compliance requirements. A major benefit of using dedicated hosts is saving money on licensing costs by leveraging your investments into existing licenses. For detailed pricing, visit the official AWS website by clicking here.

So these were the basics of Amazon EC2 Service.

 

Summary:

  • Amazon EC2 is a compute service provided by AWS which provides virtual resizable machines that help you operate and manage your resources in a specified throughput
  • With Amazon EC2, you can launch any number of instances of any size into any Availability Zone in the world in a matter of minutes.
  • Amazon EC2 offers features for configurations for cost and capacity optimization, storage options and specified operating systems and softwares as per requirement.
  • Pricing differs according to what instance service you use; on-demand instances, spot instances, reserved instances or dedicated hosts.