| Next » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable computing capacity in the cloud. Amazon EC2 eliminates your need to invest in hardware up front and enables you to develop and deploy applications faster. You can use the web service interfaces to launch as many or as few virtual servers as you need, configure security and networking, and manage storage.
With Amazon EC2, you pay only for the resources that you use. Amazon EC2 enables you to scale to handle your changes in requirements or spikes in popularity, reducing your need to forecast traffic.
Topics
As you get started with Amazon EC2, you should understand the key concepts of this computing environment and how it's similar to or different from your own computing environment.
An Amazon Machine Image (AMI) is a template that contains a software configuration (for example, an operating system, an application server, and applications). From an AMI, you launch instances, which are copies of the AMI running as virtual servers in the cloud. You can launch multiple instances of an AMI, as shown in the following figure.

Your instances keep running until you stop or terminate them, or until they fail. If an instance fails, you can launch a new one from the AMI.
Amazon publishes many AMIs that contain common software configurations for public use. In addition, members of the AWS developer community have published their own custom AMIs. You can also create your own custom AMI or AMIs; doing so enables you to quickly and easily start new instances that have everything you need. For example, if your application is a web site or web service, your AMI could include a web server, the associated static content, and the code for the dynamic pages. As a result, after you launch an instance from this AMI, your web server starts, and your application is ready to accept requests.
You can launch different types of instances from a single AMI. An instance type essentially determines the hardware of the host computer used for your instance. Each instance type offers different compute and memory capabilities. Select an instance type based on the amount of memory and computing power that you need for the application or software that you plan to run on the instance. For more information, see Available Instance Types.
When you launch an instance, the root device contains the image used to boot the instance. For more information, see Amazon EC2 Root Device Volume.
All AMIs are categorized as either backed by Amazon EBS, which means that the root device for an instance launched from the AMI is an Amazon EBS volume, or backed by instance store, which means that the root device for an instance launched from the AMI is an instance store volume created from a template stored in Amazon S3.
The description of an AMI indicates the type of root device (either ebs or instance store).
This is important because there are significant differences in what you can do with each type of AMI.
For more information about these differences, see Storage for the Root Device.
For information about AMIs and instances, see Amazon Machine Images (AMI) and Amazon EC2 Instances.
Amazon has data centers in different areas of the world (for example, North America, Europe, and Asia). Correspondingly, Amazon EC2 is available to use in different regions. By launching instances in separate regions, you can design your application to be closer to specific customers or to meet legal or other requirements. Prices for Amazon EC2 usage vary by region (for more information about pricing by region, see Amazon EC2 Pricing).
Each region contains multiple distinct locations called Availability Zones. Each Availability Zone is engineered to be isolated from failures in other Availability Zones, and to provide inexpensive, low-latency network connectivity to other zones in the same region. By launching instances in separate Availability Zones, you can protect your applications from the failure of a single location.

For more information about the available regions and Availability Zones, see Regions and Availability Zones.
When using an instance, you may have data that you need to store. Amazon EC2 offers the following storage options:
The following figure shows the relationship between these types of storage.

Amazon EBS
Amazon EBS volumes are the recommended storage option for the majority of use cases. Amazon EBS provides your instances with persistent, block-level storage. Amazon EBS volumes are essentially hard disks that you can attach to a running instance.
Amazon EBS is especially suited for applications that require a database, a file system, or access to raw block-level storage.
As illustrated in the previous figure, you can attach multiple volumes to an instance. Also, to keep a back-up copy of your data, you can create a snapshot of an EBS volume, which is stored in Amazon S3. You can create a new Amazon EBS volume from a snapshot, and attach it to another instance. You can also detach a volume from an instance and attach it to a different instance.
For more information about Amazon EBS volumes, see Amazon Elastic Block Store (Amazon EBS).
Instance Store
All instance types, with the exception of Micro instances, offer instance store, which provides your instances with temporary, block-level storage. This is storage that is physically attached to the host computer. The data on an instance store volume doesn't persist when the associated instance is stopped or terminated. For more information about instance store volumes, see Amazon EC2 Instance Store.
Instance store is an option for inexpensive temporary storage. You can use instance store volumes if you don't require data persistence.
Amazon S3
Amazon S3 is storage for the Internet. It provides a simple web service interface that enables you to store and retrieve any amount of data from anywhere on the web. For more information about Amazon S3, see Amazon Simple Storage Service (Amazon S3).
The application you're running on Amazon EC2 may need a database. The following are common ways to implement a database for your application:
Use Amazon Relational Database Service (Amazon RDS), which enables you to easily get a managed relational database in the cloud
Launch an instance of a database AMI, and use that instance as the database
Amazon RDS offers the advantage of handling your database management tasks, such as patching the software, backing up, and storing the backups. For more information about Amazon RDS, see the Amazon RDS product page.
You can launch an instance into one of two platforms: EC2-Classic or EC2-VPC. An instance that's launched into EC2-Classic is assigned a public IP address. An instance that's launched into EC2-VPC is assigned a public IP address only if it's launched into a default VPC. For more information about EC2-Classic and EC2-VPC, see Supported Platforms in the Amazon Elastic Compute Cloud User Guide.
Instances can fail or terminate for reasons outside of your control. If one fails and you launch a replacement instance, the replacement has a different public IP address than the original. However, if your application needs a static IP address, Amazon EC2 offers Elastic IP addresses. For more information, see Using Instance IP Addresses in the Amazon Elastic Compute Cloud User Guide.
You can use security groups to control who can access your instances. These are analogous to an inbound network firewall that enables you to specify the protocols, ports, and source IP ranges that are allowed to reach your instances. You can create multiple security groups and assign different rules to each group. You can then assign each instance to one or more security groups, and we use the rules to determine which traffic is allowed to reach the instance. You can configure a security group so that only specific IP addresses or specific security groups have access to the instance. For more information about security groups, see Amazon EC2 Security Groups.
AWS provides features that enable you to do the tasks described in the following table.
| Task | Relevant Guide |
|---|---|
|
Monitor basic statistics for your instances and Amazon EBS volumes. | |
|
Automatically scale your Amazon EC2 capacity up or down according to the conditions that you define. | |
|
Automatically distribute incoming application traffic across multiple Amazon EC2 instances. |
AWS provides several interfaces for accessing Amazon EC2.
The AWS Management Console is a web-based user interface. To get started, see Getting Started with Amazon EC2 Linux Instances.
The command line interface for Amazon EC2 provides a set of commands that use a Java runtime environment. To get started, see Setting Up the Amazon EC2 Command Line Interface Tools. For more information about the commands, see Amazon Elastic Compute Cloud Command Line Reference.
The following table lists the resources that you can use to access Amazon EC2 programmatically.
| Resource | Description |
|---|---|
AWS SDKs |
AWS SDKs include sample code, libraries, tools, documentation, and templates. To download the AWS SDKs, see AWS Software Development Kits (SDKs). |
|
Libraries |
Developers can provide their own libraries, which you can find at the following AWS developer centers: |
|
EC2 API |
If you prefer, you can code directly to the Amazon EC2 API. For more information, see Making API Requests , and see the Amazon Elastic Compute Cloud API Reference. |
With Amazon EC2, you pay for only what you use, and there's no minimum charge. For a complete list of charges and specific prices, see Amazon EC2 pricing.
To see your bill, go to your AWS Account Activity page. Your bill contains links to usage reports that provide details about your bill.
The following table lists related resources that you'll find useful as you work with Amazon EC2.
| Resource | Description |
|---|---|
|
A central starting point to find documentation, code samples, release notes, and other information to help you create innovative applications using AWS. | |
|
A community-based forum for discussing technical questions related to Amazon EC2. | |
| Amazon EC2 Release Notes | A high-level overview of the current release. |
|
The home page for AWS Technical Support. | |
|
The primary web page for information about AWS Support, a one-on-one, fast-response support channel to help you build and run applications on AWS. | |
|
A central contact point for inquiries concerning AWS billing, accounts, and events. This form is for account questions only. For technical questions, use the Discussion Forums. |
You can also find additional information about Amazon EC2 in the Amazon EC2 Articles & Tutorials area of the AWS web site.
To get a hands-on introduction to Amazon EC2, complete the tutorial Getting Started with Amazon EC2 Linux Instances.
You need to understand the key differences between running your application on infrastructure in the cloud versus on servers in your own data center. For more information, see the following technical whitepaper: Architecting for the Cloud: Best Practices.
It's important for you to design your application to handle the failure of a cloud infrastructure component. For example, it's inevitable that instances will eventually fail, so you need to plan for it. An instance failure isn't a problem if your application is designed to handle it. For more information, see the technical whitepaper: Building Fault-Tolerant Applications on AWS.
For a complete list of the AWS whitepapers, see the AWS Cloud Computing Whitepapers page.
Within this guide, you should read the following sections to understand features of Amazon EC2 that help you build fault tolerant applications: