Amazon EC2
Cloud service · AWS · Updated

Amazon EC2

In short

Amazon EC2 (Elastic Compute Cloud) is a web service that provides resizable compute capacity in the cloud, allowing users to run and manage virtual servers.

Cloud Services Hub →

Free Amazon EC2 tools

11 key features of Amazon EC2

Amazon EC2 offers scalable computing capacity in the AWS cloud, allowing users to launch virtual servers, configure security and networking, and manage storage.

01
Flexible Compute Options

Amazon EC2 provides a wide array of compute options, allowing users to choose the instance type that best fits their application's needs. This includes a variety of configurations based on CPU, memory, storage, and networking capacity for optimal performance and efficiency.

02
Scalability and High Availability

With Amazon EC2, you can easily scale your computing capacity up or down automatically according to conditions you define. This ensures high availability and scalability for applications and services without the need for upfront hardware investments.

03
Secure and Compliant

Amazon EC2 includes built-in security and compliance features to protect your data. This encompasses network isolation using Amazon VPC, data encryption, and comprehensive compliance programs to meet regulatory requirements.

04
Integrated with AWS Services

EC2 is seamlessly integrated with other AWS services including Amazon S3, RDS, and DynamoDB, providing a complete environment for deploying and managing applications in the cloud. This integration simplifies tasks such as data backup, disaster recovery, and more.

05
Cost-Effective

With a pay-as-you-go pricing model, EC2 users only pay for the compute capacity they consume. This eliminates the need for upfront expenses or long-term commitments, enabling businesses to manage their budgets more effectively. Additionally, EC2 offers several purchasing options to optimize costs based on specific use cases.

06
Customizable Instances

Users can customize their instances with a wide range of CPUs, memory, and storage options. This flexibility allows for the optimization of instances to specific workload requirements, ensuring efficient and cost-effective performance.

07
Global Infrastructure

Amazon EC2 is hosted in multiple location worldwide, comprising regions and Availability Zones. This global presence enables you to deploy your applications close to your users to reduce latency and improve the user experience while ensuring your data resides in the jurisdiction of your choice.

08
Amazon Machine Images

Amazon Machine Images (AMIs) are preconfigured instance templates that package the operating system and additional software needed for a server.

09
Persistent EBS Storage

Amazon EBS volumes provide persistent storage for EC2 instance data.

10
Temporary Instance Store Storage

Instance store volumes provide temporary storage whose data is deleted when the instance is stopped, hibernated, or terminated.

11
Key Pairs

Key pairs provide secure login information for instances: AWS stores the public key, while you must keep the private key secure.

Where Amazon EC2 is used

Amazon EC2 offers scalable computing capacity for hosting applications, supporting diverse workloads ranging from web and mobile applications to big data projects and enterprise-grade applications, each requiring varying levels of processing power, storage, and networking capabilities.

  1. 01
    Web Hosting

    Amazon EC2 offers scalable computing capacity in the Amazon Web Services (AWS) Cloud, which organizations can utilize to run their websites. With EC2, businesses can easily adjust their computing resources based on their website's demand, ensuring high availability and performance at lower costs compared to traditional web hosting services.

  2. 02
    Application Testing and Development

    Developers use Amazon EC2 to quickly set up and dismantle testing and development environments, bringing new applications to market faster. EC2 provides a highly flexible environment that can be tailored to match the exact hardware and software requirements of any development project, making it easier to test applications under various scenarios and workloads.

  3. 03
    Big Data Analysis

    Amazon EC2, in combination with other AWS services such as Amazon S3 and Amazon Redshift, provides a powerful platform for running big data analysis applications. Businesses can process and analyze large datasets to gain insights into customer behavior, improve products and services, and make informed decisions.

  4. 04
    Disaster Recovery

    Companies use Amazon EC2 as part of their disaster recovery plan. By leveraging EC2's global regions and availability zones, organizations can replicate their critical systems and data across different geographical locations, ensuring business continuity in the event of system failures, natural disasters, or other disruptions.

  5. 05
    High-Performance Computing (HPC)

    Amazon EC2 provides the high computing power required for HPC applications, enabling users to solve complex scientific, engineering, and business problems. With access to scalable resources, researchers and engineers can conduct simulations, genomics analysis, financial modeling, and other compute-intensive tasks more efficiently.

How Amazon EC2 is priced

Amazon EC2 pricing models include On-Demand, Reserved Instances, Spot Instances, and Dedicated Hosts, offering varying payment and commitment levels to suit different budgetary requirements.

On-Demand Instances

Pay for compute capacity by the hour or second with no long-term commitments. This offers flexibility to start or stop instances at any time, without upfront costs.

Reserved Instances

Provide a significant discount compared to On-Demand pricing in exchange for committing to use the instance for a 1-year or 3-year term.

Spot Instances

Use spare Amazon EC2 computing capacity for up to 90% off the On-Demand price.

Savings Plans

Offer up to 72% savings over On-Demand pricing, in exchange for a commitment to a consistent amount of usage (measured in $/hour) for a 1 or 3-year period.

Dedicated Hosts

Physical EC2 servers dedicated for your use, which can help you reduce costs by allowing you to use your existing server-bound software licenses.

Dedicated Instances

Instances that run in a VPC on hardware that's dedicated to a single customer, offering both physical isolation and logical isolation from instances that belong to other AWS accounts.

On-Demand Capacity Reservations

Reserve compute capacity in a specific Availability Zone for access when and for as long as you need it.

Amazon EC2 Capacity Blocks for ML

Reserve GPU instances in advance for machine learning workloads.

Services Amazon EC2 works with

Amazon S3Amazon S3

Used for storing and retrieving backup volumes, application data, and logs from EC2 instances.

Amazon RDSAmazon RDS

Provides managed relational databases that can be accessed by applications running on EC2 instances.

Amazon API GatewayAmazon API Gateway

Amazon EC2 applications can serve as API Gateway backends through public HTTP endpoints or private integrations using a VPC link and a supported load balancer. This lets an API expose an application running on instances without exposing those instances directly.

Amazon Bedrock AgentCore

Amazon Bedrock AgentCore Runtime Instances use EC2 managed instances to run agent workloads. AgentCore uses the EC2 instance identity role during instance setup.

Amazon BraketAmazon Braket

Amazon Braket Hybrid Jobs provisions classical compute instances for the classical portions of hybrid quantum algorithms. These EC2-backed resources run tasks such as preparing quantum circuits and processing their results.

Amazon CloudFrontAmazon CloudFront

Amazon EC2 instances can serve as CloudFront origins for websites and applications. CloudFront VPC origins also support private EC2 instances, allowing CloudFront to deliver their content without making the instances publicly accessible.

Amazon CloudWatchAmazon CloudWatch

Amazon EC2 publishes instance metrics to CloudWatch, where alarms can initiate actions such as stopping, terminating, rebooting, or recovering an instance. The CloudWatch agent adds operating-system metrics and logs, including memory utilization and application log files.

Amazon CodeGuruAmazon CodeGuru

Applications running on EC2 can use the CodeGuru Profiler agent to collect runtime profiles. These profiles help identify expensive code paths and CPU usage problems in supported applications.

Amazon Data FirehoseAmazon Data Firehose

EC2 instances can run the Amazon Kinesis Agent to watch local files and send their records to Amazon Data Firehose. For example, an instance can continuously forward application logs for delivery to an analytics destination.

Amazon DetectiveAmazon Detective

Amazon Detective builds investigation views around EC2 instances using security findings, CloudTrail activity, and VPC flow data. Investigators can examine an instance's network activity and related identities when investigating suspicious behavior.

What is Amazon EC2

3 min read

Amazon EC2 (Elastic Compute Cloud) is a core part of Amazon.com's cloud computing platform, Amazon Web Services (AWS). It provides scalable computing capacity in the AWS cloud, allowing businesses and developers to run applications and workloads on virtual machines, known as instances. 

EC2 also supports managed instances, which are managed by a service provider such as Amazon EKS Auto Mode. You cannot directly modify their settings; these instances have a true value in the Managed field.

Amazon EC2 eliminates the need for up-front investments in hardware, making it easier and faster for users to scale computing resources up or down, depending on their requirements. At its core, Amazon EC2 offers a virtual computing environment that gives users the flexibility to choose from a wide range of instance types. These instance types are categorized based on their memory, CPU, storage, and networking capacity, making it easier for users to select the appropriate resource mix for their applications. This flexibility is critical for optimizing the performance and cost-efficiency of workloads, whether they are large-scale data processing tasks, web applications, or game hosting. 

Dedicated Hosts give you control over instance placement on a host. Dedicated Instances provide dedicated tenancy without host-level placement control.

EC2 UltraServers connect multiple EC2 instances through a dedicated, high-bandwidth, low-latency accelerator interconnect. This provides a tightly coupled mesh of accelerators with more compute and memory than standalone instances for trillion-parameter-scale AI training and inference.

One of the key features of Amazon EC2 is its ability to rapidly scale. Users can spawn new instances in minutes, ensuring that applications can handle unexpected spikes in traffic without any manual intervention. This is particularly important for web applications that experience variable workloads. Furthermore, EC2 instances can be automatically scaled up or down using Auto Scaling based on predefined criteria such as CPU utilization or network traffic, ensuring that the application performance is consistent while keeping costs in check. 

EC2 resource quotas apply per Region, including a quota on the number of vCPUs provisioned for On-Demand Instances. Requests that would exceed a quota fail, so plan quota increases before additional capacity is needed. Service Quotas lets you view and manage quotas and request increases for many resources.

Amazon EC2 also boasts a robust security infrastructure. It integrates with Amazon Virtual Private Cloud (VPC), offering users the ability to isolate their compute instances and define a virtual networking environment. This includes IP address ranges, subnets, and network gateways, providing enhanced security and network control. Additionally, users can assign IAM (Identity and Access Management) roles to instances, manage encryption keys using AWS Key Management Service (KMS), and define security groups that act as virtual firewalls to control inbound and outbound traffic to instances. 

The service's pricing model is another aspect where its flexibility shines. Amazon EC2 offers multiple purchasing options, including On-Demand instances where users pay for compute capacity by the hour or second depending on instance type and operating system without any long-term commitments, Reserved Instances which provide a significant discount on the hourly charge in exchange for a commitment to use a specific instance type for a period of one or three years, and Spot Instances that provide unused Amazon EC2 capacity at discounted prices without bidding. 

Instance billing starts when a launched instance enters the running state, stops when the instance is stopped, and resumes when it is started again. On termination, instance billing stops when the instance enters the shutting-down state.

Overall, Amazon EC2 provides a highly reliable, scalable, and cost-efficient computing environment that adapts to the growing and varying demands of applications. Its integration with other AWS services, such as Amazon S3 for storage and Amazon RDS for databases, further enhances its capabilities, making it a go-to solution for deploying a wide variety of applications in the cloud.

Concepts related to Amazon EC2

Amazon EC2 exam questions

Real practice exam questions on Amazon EC2, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIB-C01

A logistics company is preparing a business-critical AI routing application for production. Its licensed inference software must run on company-managed virtual servers, and the operations team can maintain the operating systems. Testing has established the capacity needed for peak demand. The application is stateless, and its data layer already tolerates an Availability Zone failure. Leadership requires inference to remain available at peak demand if one Availability Zone becomes unavailable, without waiting for replacement servers to launch. Which compute infrastructure plan best meets these requirements?

Show answerCORRECT ANSWER

Deploy an Amazon EC2 Auto Scaling group across two Availability Zones behind a load balancer, maintaining enough running capacity in either zone to handle peak demand if the other zone fails.

EC2 provides the company-managed virtual servers required by the software. Distributing running instances across Availability Zones removes the single-zone dependency, while sufficient surviving capacity and load-balancer health checks allow inference to continue without waiting for replacement instances.

MLA-C02

An ML team runs independent feature-selection experiments on Amazon EC2. Each experiment takes approximately 5 minutes, and a queue automatically resubmits experiments if their workers terminate before returning results. Workers do not retain local state. The team submits thousands of experiments at irregular intervals and can wait several hours for capacity. Multiple EC2 instance types across several Availability Zones meet the performance requirements.

The project will end in 3 months, and the account has no other compute workloads. Testing shows that the cost of repeating interrupted experiments is small compared with the available discounted compute savings. Which purchasing strategy is most appropriate to minimize compute costs?

Show answerCORRECT ANSWER

Use Spot Instances with a price-capacity-optimized allocation strategy across compatible instance types and Availability Zones, and terminate workers when the queue is empty.

Spot pricing suits interruptible, delay-tolerant experiments without requiring a long-term commitment. Automatic resubmission handles lost workers, and diversification with price-capacity-optimized allocation helps select suitable Spot capacity pools while considering both availability and price. Terminating idle workers avoids unnecessary runtime charges.

SAP-C03

An enterprise is using AWS Transform to rehost 450 on-premises virtual machines to Amazon EC2. The source VMs were provisioned from standardized templates and are substantially overallocated. The migration team has collected representative CPU and memory utilization data, including quarterly processing peaks.

The platform team permits only an approved set of x86-based EC2 instance families. An AWS Optimization and Licensing Assessment (OLA) has also produced approved instance-type recommendations for 30 commercial application servers. Those recommendations must take precedence over the initial migration sizing suggestions. The company must establish compliant, right-sized target configurations before the first migration tests and wants to minimize per-server sizing work.

Which approach best meets these requirements?

Show answerCORRECT ANSWER

Configure AWS Transform EC2 recommendation preferences to use the approved instance families and generate recommendations from source utilization. Review the suggestions and modify the instance types for the 30 commercial application servers to incorporate the approved OLA recommendations before migration testing.

AWS Transform uses source server utilization to recommend appropriately sized EC2 instances and supports preferences that control instance selection. Suggested instance types can also be modified to incorporate OLA recommendations. This provides scalable initial sizing while accommodating approved exceptions before testing.

Practice Amazon EC2 in a full exam

Questions on Amazon EC2 in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn Amazon EC2 in lessons

34 short lessons on Amazon EC2 in 11 certification courses.

and 28 more lessons

Open the lessons

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.