Amazon Elastic Compute Cloud (EC2)

Get an overview of the Elastic Compute Cloud (EC2) and its core concepts.

Amazon Elastic Compute Cloud (EC2) is a resizable cloud computing capacity. It allows users to run virtual servers, known as instances, for various computing tasks. EC2 offers a secure, flexible, and scalable solution, enabling businesses to easily deploy, manage, and scale applications without investing in physical hardware.

Press + to interact

EC2 offers different benefits besides being a flexible computing capacity. It allows us to deploy instances in multiple Availability Zones (AZs) within a region in combination with different services such as elastic load balancer and auto scaling group to offer high availability within a region. In this lesson, we’ll learn the core concepts of EC2.

Press + to interact
Architecture diagram: EC2 instances deployed in multiple AZs
Architecture diagram: EC2 instances deployed in multiple AZs

Core concepts

Here are some core concepts of Amazon Elastic Compute Cloud (EC2).

Instance

An EC2 instance is a virtual server in the cloud. It can run different operating systems, including Linux, Windows, and CentOS. Instances are categories based on their computing power, memory, and networking capabilities. We can select any instance type based on our requirements.

Each instance contains a root volume to boot the instance. After launching, an instance works similarly to a server and keeps running until it is stopped, hibernated, terminated, or failed.

Amazon Machine Image (AMI)

An Amazon Machine Image (AMI) is a pre-configured virtual machine template that contains software configurations like operating systems and other packages used to launch an instance. AMIs serve as a blueprint for creating EC2 instances, allowing for easy replication and scaling of virtual servers. Multiple instances can be launched from a single AMI. AWS offers different AMIs to cater to user requirements, including the popular Amazon Linux, Ubuntu, and Windows.

Press + to interact

Instance types

Instance type specifies the type of hardware for the virtual server in the cloud. AWS offers different types of instances based on their hardware capabilities. Some instances offer more computing power, whereas others focus more on optimized memory management.

For example, compute-optimized instances provide more CPU power than the general or memory-optimized ones, making them ideal for compute-bound applications requiring higher processing power. Here’s an illustration highlighting different types of instances.

Press + to interact
EC2 instance types offered by AWS
EC2 instance types offered by AWS

Networking and security

Security is a shared responsibility between the user and AWS. While EC2 is a managed service within AWS, the infrastructure is protected by AWS. However, it’s important to note that this doesn’t absolve us of our responsibility.

AWS allows us to secure our EC2 instances through multiple networking and security options. We can secure the instance by a VPC to logically isolate the instance in the private subnet. This makes it inaccessible to the internet. Additionally, the security group controls the inbound and outbound traffic of the instance.

Storage

AWS offers different flexible and easy-to-use data storage options for EC2 instances. Each option has its performance perks and cost. For example, Amazon Elastic Block Store (EBS) offers durable block-level storage that can be detached and attached to a different instance, whereas Amazon Elastic File Storage (EFS) offers scalable file storage that can be connected to multiple instances and act as shared file storage for multiple applications.

Press + to interact
Storage options for EC2 instances
Storage options for EC2 instances

EC2 can use different storage services based on user requirements and infrastructure. The storage options available for EC2 instances can be used independently or in combination with multiple instances.

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Educative's Terms of Service and Privacy Policy