An Overview Of AWS EC2 Features, Types, Instances + Pricing

AWS EC2 (Amazon Elastic Compute Cloud) is the AWS service that rents you virtual servers, called instances. You pick the CPU, memory, storage and operating system, launch in minutes, and pay only while the instance runs.

It is the base layer under much of Amazon Web Services: containers, managed databases and load balancers all run on EC2 capacity. On-Demand Linux instances are billed by the second, with a one-minute minimum.

What this page covers:

  • What is the AWS EC2 service by Amazon?
  • What is an AWS EC2 instance?
  • What are AWS EC2 benefits?
  • Frequently Asked Questions (FAQs)

Worried about the bill before you launch anything? See what AWS really costs per month and set an AWS billing alert first.

What is the AWS EC2 service by Amazon?

AWS EC2 instances of different sizes on a cloud platform with a launch button
An EC2 instance is a virtual server you size to the job, from a small test box to a large production machine.
Server Type Virtual private server
Initial ByAugust 25, 2006 (public beta)
Supported OSLinux Microsoft Windows FreeBSD macOS
Language AvailabilityEnglish
Licensed ByProprietary software
Amazon Elastic Compute Cloud (EC2)

Amazon Elastic Compute Cloud Service provides developers with flexibility with resizable cloud computing capacity to deploy and build applications. Amazon EC2 is a virtual server machine that can be used in place or a physical server to deploy and run applications.

The AWS EC2 service by Amazon reduces the need for a physical server or machine to build and run applications and allows to save costs and space.

Auto Scaling groups add instances when demand rises and remove them when it falls, so you are not paying for idle servers overnight. See how AWS Auto Scaling works for the setup. Put an AWS Elastic Load Balancer in front of the group so requests only reach healthy instances.

Most operating systems are supported easily by platforms such as Windows, Linux, and even custom OS. This adaptability has enabled limitless possibilities for running an application using the AWS EC2.

What is an AWS EC2 instance?

An AWS EC2 instance is a virtual server on the Amazon cloud. When you launch an instance, the copy of the AMI (Amazon Machine Image), consisting of the software configuration you specified, is launched for your use.

Many types of instances can be launched from one AMI, but the type of instance you choose will determine the hardware of the computer that would be used for your instance. Every instance is different and offers various memory and computational abilities.

AWS groups EC2 instance types into families by workload: general purpose, compute optimized, memory optimized, storage optimized, accelerated computing and high-performance computing.

The letters and number in a name such as m7g.large tell you the family, the generation and the size. Pick the family first, then the smallest size that fits.

1. General Purpose

AWS EC2 general-purpose instances provide a stable balance of storage, computing, and networking resources.

See also  What Is AWS Data Pipeline: Features, Benefits, Pricing

These instances are called general purpose because they can be utilized for a variety of workloads and diverse applications. General-purpose instances work best for applications that utilize memory, networking, and computing resources in similar proportions.

2. Compute Optimized

Compute-optimized instances work best for applications that require high performance from the processing unit.

3. Memory Optimized

Memory-optimized instances provide spectacular performance on workloads that need fast computing with massive data sets in the memory.

4. Accelerated Computing

Accelerated computing instances utilize co-processors and hardware accelerators to perform operations much more efficiently and quickly.

5. Storage Optimized

Storage-optimized instances are perfect for operations that need excellent input and output performances on massive sets of data stored locally.

How do you create an instance?

We can create an EC2 instance through mainly 2 ways, which are as below:

  • AWS Console: Login to the console and search for EC2 and follow the step-by-step guidelines to set up an EC2 instance.
  • Cloudformation: We can pass on all the parameters in the cloud formation template and deploy it in AWS which in turn will create an EC2 instance as per the parameters specified.
  • Third party tools such as terraform or others to create the instance.

What are AWS EC2 benefits?

There are many AWS EC2 benefits when you choose it for your cloud computing needs.

AWS EC2- Reliability

Amazon EC2 is an extremely dependable environment where developers can easily and quickly commission replacement instances. This service lies within Amazon’s network infrastructure and data centers.

AWS EC2 Pricing, Cost-Effectiveness

Amazon EC2 ensures you give only a small fee for the computing capacity you use. Different instance price structures can cater to different workloads such as dedicated hosts, spot instances, reserved instances, and on-demand instances.

AWS EC2- Security

One of the best AWS EC2 benefits is that it collaborates with Amazon VPC to provide sturdy functionality for networking and security for your computational resources.

You can specify an IP range for your Virtual Private Cloud and choose which instances are private and public on the internet.

AWS EC2- Full Control

You are in total control of all your instances. You can choose to interact with anyone with the root access that you possess. You can stop, restart, reboot, and control the console output of the instances.

Quick steps for setting up an EC2?

Follow along to set up an EC2 instance, here we will be doing it from the AWS Console. So, let’s begin:

Step 1: Open the console and navigate to the EC2 page. Below is the screenshot of the start page where we can see a lot of options along with the overview of all the resources created related to our instances.

AWS EC2
AWS EC2

Step 2: Click on the launch instance button and click on the launch instance to initiate the process to start creating an EC2 machine.

AWS EC2 Launch Page
AWS EC2 Launch

Step 3: Choose the type of AMI that you would like to have in your EC2 instance. You can see a lot of options available but here we are going with the free available AMI’s for the demo. Anyone from the below option is fine only difference is the Linux kernel version in them.

AWS EC2 AMI
AWS EC2 AMI Selection

Step 4: Pick the instance type. Each one has a different mix of CPU, memory and storage. A t3.micro or t2.micro is enough for a demo; whether it is free depends on your account’s Free Tier plan and credits.

AWS EC2 Instance Type
AWS EC2 Instance Type

Step 5: This is the place where all the configurations like VPC, and Subnets can be selected but we are going with the default VPC as we are doing a setup for Demo.

AWS EC2 Configuration
AWS EC2 Configuration Part 1

Step 6: In this part also we have different config settings for the EC2 machine which also includes User Data, here we can pass any bootstrap script which we would like to be executed once our machine is up and running.

AWS EC2 Configuration
AWS EC2 Configuration Part 2

Step 7: This is the place where you can add or modify the storage capacity of the machine. You can either increase the storage or add additional storage to the machine.

AWS EC2 Storage
AWS EC2 Storage

Adding additional EBS volume in the machine and here we are not selecting Delete on Termination option, that means even if we terminate this machine our volume and data in it is safe.

AWS EC2 Additional Storage
AWS EC2 Additional Storage

We can choose the type of volume based on the requirement of performance along with the option of enabling encryption on these volumes.

AWS EC2 Volume Type & Encryption
AWS EC2 Volume Type & Encryption

Step 8: Give a tag to your machine based on the purpose for easy identification of the machine.

AWS EC2 Tag Config
AWS EC2 Tag Config

Step 9: This is a very important point because this will decide the level and type of access to your EC2 machine. Creating and attaching a proper Security Group is one of the most important steps for protecting your machine from unauthorized access.

AWS EC2 Security Group
AWS EC2 Security Group

Step 10: This is the final confirmation page which shows all the options selected for the machine. Review the configurations and click on launch.

AWS EC2 Confirmation
AWS EC2 Confirmation

Step 11: Key Pair helps you ssh into your instance, so either create a new one or use the one if you already have it. Important point is to keep it safe in fact very safe. Download the Key pair and hit launch instance.

AWS EC2 Key Pair
AWS EC2 Key Pair

Step 12: Congrats you have created your first EC2 instance.

AWS EC2 Up and Running
AWS EC2 Up and Running

How to increase root volume in AWS EC2

Increase EC2 root volume: an EBS disk growing while it stays attached to the instance
An EBS volume can be made larger while it stays attached; you then extend the file system inside the instance.

You can grow an EBS volume while the instance is running. On current-generation instances, Elastic Volumes lets you change the size without detaching the volume or restarting the instance, and that includes the root volume.

See also  2024 Best 51 AWS EC2 Interview Questions and Answers

After the resize, extend the partition and file system inside the operating system, or the extra space stays unused. AWS allows up to four modifications per volume in a rolling 24-hour period.

We can add additional EBS volumes to an EC2 while creating and even after it’s created and running.

Select the Attach Volume from the dropdown as shown in the figure and select the EC2 you would like the volume to be attached and we are good to go.

AWS EC2 Additional EBS
AWS EC2 Additional EBS Attachment

how to ssh into AWS eC2 instance?

SSH into an EC2 instance: a laptop with a private key connecting through a firewall rule to the server
SSH needs two things to line up: the private key that matches the instance key pair, and a security group rule that allows port 22 from your IP.

The steps below use PuTTY on Windows. On Windows 10 and later, macOS and Linux you can skip PuTTY and run ssh -i my-key.pem ec2-user@PUBLIC-IP from a terminal.

A third option is EC2 Instance Connect: select the instance, choose Connect, and a browser-based shell opens with no key file to manage.

Step 1: Download Putty and Puttygen.

Step 2: Open Puttygen load the pem file and save it as ppk file as shown below.

EC2-SSH Puttygen File Conversion
EC2-SSH Puttygen File Conversion

Step 3: Open the console select the instance and hit connect.

EC2-SSH Connection Details
EC2-SSH Connection Details

Step 4: Copy the information which is highlighted below.

EC2-SSH Connection String
EC2-SSH Connection String

Step 5: Open Putty and paste the copied data in the Host Name

EC2-SSH Putty Setup
EC2-SSH Putty Setup

Step 6: Go to Auth and Select the ppk file created in Puttygen

EC2-SSH Putty KeyPair Setup
EC2-SSH Putty KeyPair Setup

Step 7: Go back to Session and give a name in Saved Sessions and click Save.

EC2-SSH Save Details in Putty
EC2-SSH Save Details in Putty

Step 8: Click open in putty and you could see the below prompt, Accept there.

EC2-SSH Login
EC2-SSH Login

Step 9: Yay!! You have successfully logged into your EC2 using the public ip address.

EC2-SSH Login Successful
EC2-SSH Login Successful

AWS EC2 vs fargate

We have the option of running containers in AWS which is popularly known as Elastic Container Service (ECS) with EC2 or with Fargate. Let’s check out the difference while running ECS between EC2 and Fargate:

ECS backed by EC2ECS backed by Fargate
Runs on EC2 instancesServerless
User-managed instances. User has to manually scale, secure, and provision the instancesNo manual provision of instances as its serverless
More granular control over the infrastructureFargate manages, runs, and configures the infrastructure
Users can choose the type of EC2 hardware they want to run.The user just specifies the CPU and memory rest is managed by Fargate
Usually cheaper at steady, high utilizationLess to manage; often a higher price than the same capacity on EC2

AWS EC2 vs lightsail

Now, it’s time to compare EC2 and Lightsail on the basis of hosting websites and related facilities in them. So, let’s jump in:

See also  What Is Amazon QuickSight: Features, Pricing + How To Use
EC2Lightsail
A lot of configurations are required and other services combined for deploying a website.Quick and easy to deploy a website.
Configurations can be altered to boost performanceLess configurable as it has a preset of options in them
Compute capacity can be increased to a lot.Limited compute capacity
Storage capacity can be increased as much as requiredLimited storage range of 20 GB to 640 GB
Load balancers for websites have to be configured separatelyHandles load balancing automatically
DB has to be configured separately for websitesIt comes with a database

AWS EC2 vs Azure VM

As we all know AWS and Azure are the key players in the market providing cloud services. So, let’s check out the difference between their compute service which is AWS EC2 and Azure VM:

AWS EC2Azure VM
Many options are available based on the user requirementSame here as well, options available based on user preferences
Pricing is competitivePricing is competitive
AWS provides Predictive Scaling of InstancesAzure offers predictive autoscale for Virtual Machine Scale Sets
AWS gives the option to hibernate the InstanceAzure VMs also support hibernation on supported sizes
Saving Plan billing model that saves costAzure has a savings plan for compute too

AWS EC2 vs elastic beanstalk

Let’s try to find the difference between these 2 services of AWS:

EC2Beanstalk
Standalone instance in the cloudIts an environment in the cloud that can contain a number of EC2 instances, DB as well as Load Balancers
More control over the instance configurationIt manages the underlying AWS Services
Pay as per the plan availed.Pay for all the underlying services provisioned
Autoscaling has to be configured separatelyAutoscaling of application up and down
Fairly complex as all the setup has to be done manuallySimple to deploy the application in Beanstalk

AWS EC2 vs ECS

EC2ECS
EC2 is a virtual machine in the cloudA container orchestration service that schedules Docker containers
Applications can be run inside an EC2 instance aloneECS runs containers on EC2 instances you manage, or on Fargate with no instances

AWS EC2 vs Lambda

As we all know AWS EC2 and Lambda are two computer services from AWS, let us find out how they are different:

EC2Lambda
Virtual Machines which are also called InstancesThis is a serverless service from AWS
More control over the system where the application is runningDo not have any control as its hidden and managed automatically by AWS
Once an Instance is created it keeps running till stopped even though there is no load on the instanceBeing serverless it triggers when there is an event, it processes the task and stops automatically
Scaling horizontally and vertically has to be configuredScales seamlessly on its own based on the events configured
Pay for the time EC2 is running even though with no workPay for each trigger, time taken to run, memory consumed
Setup and configurations has to be done manuallyJust publish the code in Lambda and AWS will take care of the rest
Suited to long-running work such as machine learning and large data processingBest for short event-driven jobs; a single run is capped at 15 minutes

How to delete AWS EC2 instance?

EC2 instance states: running, stopped with its disk kept, and terminated with its disk removed
Stopping an instance keeps its EBS volume, so you can start it again. Terminating deletes the instance and, by default, its root volume too.

To Stop or Terminate an EC2 instance based on the requirement refer to the screenshot below:

AWS EC2 Stop or Terminate
AWS EC2 Stop or Terminate

Stop and terminate are not the same. A stopped instance keeps its EBS volumes, so you still pay for that storage, and it can be started again.

A terminated instance is gone for good, and its root volume is deleted by default.

EC2 Pricing

EC2 pricing models compared: On-Demand, Reserved Instances, Savings Plans and Spot
EC2 has four main ways to pay: On-Demand with no commitment, Reserved Instances, Savings Plans, and Spot for spare capacity at a discount.

EC2 pricing comes in four main models. On-Demand has no commitment. Savings Plans and Reserved Instances trade a one- or three-year commitment for a lower rate.

Spot Instances sell spare capacity at a steep discount, but AWS can reclaim them with a two-minute warning. Dedicated Hosts give you a whole physical server. Within each model, the price depends on:

  1. Type of the instance. Spot, on-demand, and dedicated instances have different pricing catalog
  2. The price of the EC2 also depends on the size i.e. computing and storage capacity of the machine.
AWS EC2 explained pin: a virtual server with its storage, key, shield and costs under a cloud
EC2 in one picture: a virtual server plus the storage, keys, firewall rules and pricing you choose for it.

FAQs: On AWS EC2

Q1. What Is The Most Reliable Resource For AWS EC2 Documentation?

The complete documentation for AWS EC2 can be found on the AWS website here. Here, you will be able to learn about AWS EC2 Instances, best practices, and find troubleshooting advice.

Q2. Where Can I Find A Good AWS EC2 Tutorial?

You can find good and easy tutorials about AWS EC2 from the Documentation section of AWS EC2 here. If you would like more expansive knowledge about AWS EC2, you should visit the Getting Started page for more information.

Q3. What Is AWS EC2 CLI?

Amazon Web Services CLI (Command Line Interface) is an integrated tool that allows users to manage their subscribed AWS services.

With the AWS CLI tool alone, you can control a variety of AWS services from the command line and even automate some of them using scripts. Multiple features of Amazon EC2 can be accessed by using the AWS CLI.

Q: AWS EC2 Images?

To Spin up an EC2 instance in AWS, we are provided with a preconfigured template which is popularly known as an Amazon Machine Image or AMI which can be used to create an instance faster and with ease.

Q: AWS EC2 Cloudformation?

EC2 Cloudformation is a template with all the details for creating the instance automatically by just uploading the template in AWS.
The benefit of doing this is to avoid user mistakes when doing multiple deployments in the same or different environments.

Q: How to host a website on AWS EC2?

AWS EC2 has the flexibility of hosting a website in it, for the detailed step-by-step process click here.

Q: Is AWS EC2 run on VM?

EC2 is a VM itself in the cloud provided by AWS

Q: AWS EC2 fall under Paas or IaaS?

EC2 falls under Infrastructure as a Service which is IaaS.

You may also like these AWS guides:

Conclusion

We hope that you found the article helpful and were able to learn in-depth about AWS EC2 Instance types, AWS EC2. This article covers discussions about the following topics

  • What is the AWS EC2 service by Amazon?
  • What is an AWS EC2 instance?
  • What are AWS EC2 benefits?
  • Frequently Asked Questions (FAQs)

We hope that with the help of this article; you were able to understand AWS EC2 much more easily. Keep Clouding!!

3 thoughts on “An Overview Of AWS EC2 Features, Types, Instances + Pricing”

Leave a Comment