AmazonElasticComputeCloud-Getting Started With EC2

Embed Size (px)

Citation preview

  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    1/19

    Amazon Elastic Compute Cloud

    Getting Started Guide

    API Version 2013-10-01

  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    2/19

    Amazon Web Services

    Amazon Elastic Compute Cloud Getting Started Guide

  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    3/19

    Amazon Elastic Compute Cloud: Getting Started GuideAmazon Web ServicesCopyright 2013 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

    The following are trademarks of Amazon Web Services, Inc.: Amazon, Amazon Web Services Design, AWS, Amazon CloudFront,Cloudfront, Amazon DevPay, DynamoDB, ElastiCache, Amazon EC2, Amazon Elastic Compute Cloud, Amazon Glacier, Kindle, Kindle

    Fire, AWS Marketplace Design, Mechanical Turk, Amazon Redshift, Amazon Route 53, Amazon S3, Amazon VPC. In addition,Amazon.com graphics, logos, page headers, button icons, scripts, and service names are trademarks, or trade dress of Amazon inthe U.S. and/or other countries. Amazon's trademarks and trade dress may not be used in connection with any product or service thatis not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discreditsAmazon.

    All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connectedto, or sponsored by Amazon.

    Amazon Elastic Compute Cloud Getting Started Guide

  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    4/19

    Getting Started ....................................................................................................................................... 1Step 1: Launch an Instance .................................................................................................................... 2Step 2: Connect to Your Instance ............................................................................................................ 3Step 3: Add a Volume ............................................................................................................................. 6Step 4: Clean Up .................................................................................................................................... 8Where Do I Go from Here? ..................................................................................................................... 9

    Document History ................................................................................................................................. 14Please Provide Feedback ..................................................................................................................... 15

    API Version 2013-10-014

    Amazon Elastic Compute Cloud Getting Started Guide

  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    5/19

    Getting Started with Amazon EC2Linux Instances

    Let's get started with Amazon Elastic Compute Cloud (Amazon EC2) by launching, connecting to, andusing a Linux instance. We'll use the AWS Management Console, a point-and-click web-based interface,to complete the example architecture shown in the following diagram:

    The instance is an Amazon EBS-backed instance (meaning that the root volume is an Amazon EBSvolume).We'll also create and attach an additional Amazon EBS volume.You can either specify theAvailability Zone in which your instance runs, or let us select an Availability Zone for you.When youlaunch your instance, you secure it by specifying a key pair and security group. (This exercise assumesthat you created a key pair and a security group when getting set up; see Get Set Up for Amazon EC2.)When you connect to your instance, you must specify the private key of the key pair that you specifiedwhen launching your instance.

    To complete this exercise, perform the following tasks:

    1. Launch an Amazon EC2 Instance (p. 2)

    2. Connect to Your Instance (p. 3)

    3. Add a Volume to Your Instance (p. 6)

    4. Clean Up Your Instance and Volume (p. 8)

    Related Topics

    API Version 2013-10-011

    Amazon Elastic Compute Cloud Getting Started Guide

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    6/19

    If you'd prefer to launch and connect to a Windows instance, see this tutorial: Getting Started with AmazonEC2 Windows Instances.

    For tutorials that show you how to use additional AWS products and services with Amazon EC2, seeGetting Started with AWS.

    Launch an Amazon EC2 InstanceYou can launch a Linux instance using the AWS Management Console as described in this topic. Beforeyou begin, be sure that you've completed the steps in Get Set Up for Amazon EC2.

    ImportantWhen you sign up for AWS, you can get started with Amazon EC2 for free using the AWS FreeUsage Tier. If you created your AWS account less than 12 months ago, and have not alreadyexceeded the Free Usage Tier benefits for Amazon EC2 and Amazon EBS, it will not cost youanything to complete this tutorial, because we help you select options that are within the FreeUsage Tier benefits. Otherwise, you'll incur the standard Amazon EC2 usage fees from the timethat you launch the instance until you terminate the instance (which is the final task of this tutorial),even if it remains idle. The total charges to complete this tutorial outside the Free Usage Tier

    are minimal (typically only a few dollars).

    To launch an instance

    1. Sign in to the AWS Management Console and open the Amazon EC2 console athttps://console.aws.amazon.com/ec2/.

    2. From the console dashboard, click Launch Instance.

    3. The Select an Amazon Machine Image (AMI)page displays a list of basic configurations calledAmazon Machine Images (AMIs) that serve as templates for your instance. Select the 64-bit AmazonLinux AMI. Notice that this configuration is marked "Free tier eligible."

    4. On the Select an Instance Typepage, you can select the hardware configuration of your instance.Thet1.microinstance is selected by default. Click Review and Launchto let the wizard completeother configuration settings for you, so you can get started quickly.

    5. On the Review Instance Launchpage, you can review the settings for your instance.

    Under Security Groups, you'll see that the wizard created and selected a security group for you.Instead, select the security group that you created when getting set up using the following steps:

    a. Click Edit security groups.

    b. On the Configure Security Grouppage, ensure the Select an existing security groupoptionis selected.

    c. Select your security group from the list of existing security groups, and click Review and Launch.

    6. On the Review Instance Launchpage, click Launch.

    7. In the Select an existing key pair or create a new key pairdialog box, select Choose an existing

    key pair, then select the key pair you created when getting set up.

    Alternatively, you can create a new key pair. Select Create a new key pair, enter a name for thekey pair, and then click Download Key Pair. This is the only chance for you to save the private keyfile, so be sure to download it. Save the private key file in a safe place.You'll need to provide thename of your key pair when you launch an instance and the corresponding private key each timeyou connect to the instance.

    API Version 2013-10-012

    Amazon Elastic Compute Cloud Getting Started Guide

    Step 1: Launch an Instance

    http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_GetStarted.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_GetStarted.htmlhttp://aws.amazon.com/documentation/gettingstarted/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.htmlhttp://aws.amazon.com/free/http://aws.amazon.com/free/https://console.aws.amazon.com/ec2/https://console.aws.amazon.com/ec2/http://aws.amazon.com/free/http://aws.amazon.com/free/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.htmlhttp://aws.amazon.com/documentation/gettingstarted/http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_GetStarted.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_GetStarted.html
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    7/19

    A key pair enables you to connect to a Linux instance through SSH. Therefore, don't select theProceed without a key pairoption. If you launch your instance without a key pair, then you can'tconnect to it.

    When you are ready, select the acknowledgment check box, and then click Launch Instances.

    8. A confirmation page lets you know that your instance is launching. Click View Instancesto close

    the confirmation page and return to the console.9. On the Instancesscreen, you can view the status of your instance. It takes a short time for an

    instance to launch. When you launch an instance, its initial state is pending. After the instancestarts, its state changes to running, and it receives a public DNS name. (If the Public DNScolumnis hidden, click the Show/Hideicon and select Public DNS.)

    Next Step

    Now that you've launched your instance, you can connect to it and use it. For more information, seeConnect to Your Instance (p. 3).

    Connect to Your InstanceAfter you launch your instance, you can connect to it and use it the way that you'd use a computer sittingin front of you.

    If you receive an error while attempting to connect to your instance, see Troubleshooting Connecting toYour Instance.

    Before you try to connect to your instance, be sure that you've completed the following tasks:

    Get the public DNS name of the instance

    You can get the public DNS for your instance using the Amazon EC2 console (check the Public DNScolumn; if this column is hidden, click the Show/Hideicon and select Public DNS). If you prefer, youcan use the ec2-describe-instancescommand.

    Locate the private keyYou'll need the fully-qualified path of the .pemfile for the key pair that you specified when you launchedthe instance.

    Enable inbound SSH traffic from your IP address to your instance

    Ensure that the security group associated with your instance allows incoming SSH traffic from your IPaddress. For more information, see Authorizing Network Access to Your Instances.

    There are several ways to connect to a Linux instance. Choose the method that meets your needs:

    Option 1: Connect Using Your Browser (p. 4)

    Option 2: Connect from Windows Using PuTTY (p. 4)

    Option 3: Connect from Linux Using an SSH Client (p. 6)

    Next Step

    After you've successfully launched and connected to your instance, you can do any of the following:

    Continue to the next step in this tutorial, Add a Volume to Your Instance (p. 6).

    Continue using this instance with a different tutorial, such as Installing a LAMP Web Serveror Hostinga WordPress Blog.

    API Version 2013-10-013

    Amazon Elastic Compute Cloud Getting Started Guide

    Step 2: Connect to Your Instance

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-DescribeInstances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-DescribeInstances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    8/19

    Skip to the last step in this tutorial, Clean Up Your Instance and Volume (p. 8), to terminate the instanceso that you don't continue to incur charges.

    Option 1: Connect Using Your Browser

    You must have Java installed and enabled in the browser. If you don't have Java already, you can contactyour system administrator to get it installed, or follow the steps outlined in the following pages: InstallJavaand Enable Java in your web browser.

    To connect to your Linux instance using a web browser

    1. From the Amazon EC2 console, click Instancesin the navigation pane.

    2. Select the instance, and then click Connect.

    3. Click A Java SSH client directly from my browser (Java required) .

    4. Amazon EC2 automatically detects the public DNS name of your instance and populates PublicDNSfor you. It also detects the key pair that you specified when you launched the instance. Completethe following, and then click Launch SSH Client.

    a. In User name, enter ec2-user.TipFor Amazon Linux, the user name is ec2-user. For RHEL5, the user name is often

    rootbut might be ec2-user. For an Ubuntu, AMI the user name is ubuntu. Otherwise,check with your AMI provider.

    b. In Private key path, enter the fully qualified path to your private key (.pem) file.

    c. Click Store in browser cacheto store the location of the private key in your browser cache.This enables Amazon EC2 to detect the location of the private key in subsequent browsersessions, until you clear your browser's cache.

    5. When prompted to add the host to your set of known hosts, click No.

    6. If necessary, click Yesto trust the certificate.

    7. Click Runto run the MindTerm client.

    8. If you accept the license agreement, click Accept.

    9. If this is your first time running MindTerm, a series of dialog boxes asks you to confirm setup for yourhome directory and other settings. Confirm these settings. A window opens and you are connectedto your instance.

    Option 2: Connect from Windows Using PuTTY

    PuTTY doesn't use .pemfiles, it uses .ppkfiles. If you haven't already generated a .ppkfile, do so now.For more information, see To prepare to connect to a Linux instance from Windows using PuTTY.

    To connect to your Linux instance using PuTTY

    1. Start PuTTY (from the Startmenu, click All Programs > PuTTY > PuTTY).

    2. In the Category pane, select Sessionand complete the following fields:

    a. In the Host Namebox, enter ec2-user@public_dns_name.

    b. Under Connection type, select SSH.

    c. Ensure that Portis 22.

    API Version 2013-10-014

    Amazon Elastic Compute Cloud Getting Started Guide

    Option 1: Connect Using Your Browser

    http://java.com/en/download/help/index_installing.xmlhttp://java.com/en/download/help/index_installing.xmlhttp://java.com/en/download/help/enable_browser.xmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html#prepare-for-puttyhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html#prepare-for-puttyhttp://java.com/en/download/help/enable_browser.xmlhttp://java.com/en/download/help/index_installing.xmlhttp://java.com/en/download/help/index_installing.xml
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    9/19

    3. In the Categorypane, expand Connection, expand SSH, and then select Auth. Complete thefollowing:

    a. Click Browse.

    b. Select the .ppkfile that you generated for your key pair, and then click Open.

    c. Click Opento start the PuTTY session.

    4. If this is the first time you have connected to this instance, PuTTY displays a security alert dialogbox that asks whether you trust the host you are connecting to. Click Yes. A window opens and youare connected to your instance.

    API Version 2013-10-015

    Amazon Elastic Compute Cloud Getting Started Guide

    Option 2: Connect from Windows Using PuTTY

  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    10/19

    Option 3: Connect from Linux Using an SSH Client

    Your Linux computer most likely includes an SSH client by default. You can check for an SSH client bytyping sshat the command line. If your computer doesn't recognize the command, the OpenSSH projectprovides a free implementation of the full suite of SSH tools. For more information, see

    http://www.openssh.org .

    Open your command shell and run the following command:

    ssh -i /path/key_pair.pem ec2-user@public_dns_name

    TipFor Amazon Linux, the user name is ec2-user. For RHEL5, the user name is often rootbutmight be ec2-user. For an Ubuntu, AMI the user name is ubuntu. Otherwise, check with yourAMI provider.

    Add a Volume to Your InstanceNow that you've launched and connected to your Linux instance, you can run the following command onyour instance to view its mounted volumes.

    $ df -h

    For a micro instance, your output should look something like this.

    Filesystem Size Used Avail Use% Mounted on

    /dev/xvda1 8.0G 1.1G 6.9G 14% /

    tmpfs 298M 0 298M 0% /dev/shm

    The /dev/xvda1volume is the root device volume. It contains the image used to boot the instance.Notice that there's some room to install additional software on your instance. For example, you can usethe yumcommand to download and install packages.

    If you need additional storage for your data, a simple solution is to add Amazon EBS volumes to yourinstance. An Amazon EBS volume serves as network-attached storage for your instance. Let's add avolume to the Linux instance that you've launched. First we'll use the EC2 console to create the volumeand attach it to the instance, and then we'll mount the volume to make it available.

    To create and attach an Amazon EBS volume

    1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

    2. In the navigation bar, select the region in which you created your instance, and then click Instancesin the navigation pane.

    The console displays the list of current instances in that region. Select your Linux instance. In theDescriptiontab in the bottom pane note the Availability Zonefor the instance.

    3. In the navigation pane, under Elastic Block Store, click Snapshots. Select Public Snapshotsfromthe Viewinglist. Select a snapshot from the list and note its snapshot ID. The Free Usage Tierprovides up to 30 GB of Amazon Elastic Block Storage; therefore, to avoid being charged for thistutorial, choose a snapshot that is smaller than 30 GB.

    4. Click Create Volume.

    API Version 2013-10-016

    Amazon Elastic Compute Cloud Getting Started Guide

    Option 3: Connect from Linux Using an SSH Client

    http://www.openssh.org/https://console.aws.amazon.com/ec2/https://console.aws.amazon.com/ec2/http://www.openssh.org/
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    11/19

    5. The Create Volumedialog box is preconfigured with the snapshot ID and volume size of the snapshotyou selected. Configure the following, and then click Yes, Create:

    Select the Standardvolume type to create a standard EBS volume.

    Select the same Availability Zonethat you used when you created your instance. Otherwise, youcan't attach the volume to your instance.

    6. In the navigation pane, under Elastic Block Store, click Volumes. Notice that your newly createdvolume appears there and the state of the volume is available, so it's ready to be attached to aninstance.

    7. Right-click the newly created volume and select Attach Volume.

    8. In the Attach Volumedialog box, configure the following, and then click Yes, Attach:

    Select your Linux instance from the list.

    Specify an unused device name for that instance.We'll use /dev/sdfin this tutorial. If you selecta different device name, be sure to note it as you'll need this information in the next procedure.

    You'll notice that in the Detailspane for your volume, the state of the volume is in-use, and the volumeis attached to your instance with the device name /dev/sdf. However, if you return to your instance andrun the df -hcommand again, you won't see the volume yet.That's because we need to mount the volumeto make it available.

    To make a volume available

    1. To mount the volume as /mnt/my-data, run the following commands.

    $ sudo mkdir/mnt/my-data

    $ sudo mount/dev/sdf /mnt/my-data

    If you attached the volume using a device name other than /dev/sdf, be sure to specify that devicename. Otherwise, you might receive the following error when you run this mount command: "mount:you must specify the filesystem type".

    2. Now when you run the df -hcommand, you'll see output like the following.

    Filesystem Size Used Avail Use% Mounted on

    /dev/xvda1 8.6G 1.2G 7.4G 14% /

    tmpfs 313M 0 313M 0% /dev/shm

    /dev/xvdf 5.0G 4.3G 442M 91% /mnt/my-data

    3. To view the contents of the new volume, run the following command.

    $ ls /mnt/my-data

    At this point, you have completed the example architecture for this tutorial.You can continue to customizeand use your instance for as long as you wish.

    ImportantRemember, if you launched an instance in the Free Usage Tier, there are no charges. Otherwise,as soon as your instance starts to boot, you're billed for each hour or partial hour that you keep

    API Version 2013-10-017

    Amazon Elastic Compute Cloud Getting Started Guide

    Step 3: Add a Volume

  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    12/19

    the instance running, even if the instance is idle. You'll stop incurring charges for a regularinstance as soon as the instance status changes to shutting downor terminated.

    When you're finished with your instance, don't forget to clean up any resources you've used and terminatethe instance, as shown in the next step, Clean Up Your Instance and Volume (p. 8).

    Clean Up Your Instance and VolumeAfter you've finished with the instance and the Amazon EBS volume that you created for this tutorial, youshould clean up. First, terminate the instance, which detaches the volume from the instance, and thendelete the volume.

    Terminating an instance effectively deletes it because you can't reconnect to an instance after you'veterminated it. This differs from stopping the instance; when you stop an instance, it is shut down and youare not billed for hourly usage or data transfer (but you are billed for any Amazon EBS volume storage).Also, you can restart a stopped instance at any time. For more information about the differences betweenstopping and terminating an instance, see Stopping Instances.

    To terminate the instance1. Locate your instance in the list of instances on the Instancespage. If you can't find your instance,

    verify that you have selected the correct region.

    2. Right-click the instance, and then click Terminate.

    3. Click Yes,Terminatewhen prompted for confirmation.

    EBS volumes can persist even after your instance is terminated. If you created and attached an EBSvolume in the previous step, it was detached when you terminated the instance. However, you mustdelete the volume, or you'll be charged for volume storage if the storage amount exceeds the l imit of theFree Usage Tier. After you delete a volume, its data is gone and the volume can't be attached to anyinstance.

    To delete the volume

    1. Locate the volume that you created in the list of volumes on the Volumespage. If you can't find yourvolume, verify that you have selected the correct region.

    2. Right-click the volume, and then click Delete.

    3. Click Yes, Deletewhen prompted for confirmation.

    Amazon EC2 begins deleting the volume.

    API Version 2013-10-018

    Amazon Elastic Compute Cloud Getting Started Guide

    Step 4: Clean Up

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    13/19

    Where Do I Go from Here?

    Topics

    AWS Account and Security Credentials (p. 9) Ways to Access Amazon EC2 (p. 9)

    Designing Your Application for the Cloud (p. 10)

    Learn More about Amazon EC2 (p. 10)

    Amazon EC2 Resources (p. 13)

    Amazon EC2 is a rich service offering many features that we haven't covered in this guide, such ascreating your own AMIs, using persistent storage, monitoring instance health, load balancing, and virtualprivate networking.This topic provides links to additional resources that will help you deepen yourunderstanding and use of Amazon EC2.

    AWS Account and Security CredentialsSo far you signed up for the service, got an AWS account and security credentials, and then completeda short exercise covering the essential product functions. Now that you're finished with the exercise, werecommend that you check with an administrator or coworker in your organization to determine if he orshe already has an AWS account and security credentials for you to use in future interactions with AWS.

    If you're an account owner or administrator and want to know more about AWS Identity and AccessManagement, go to the product description at http://aws.amazon.com/iamor to the technical documentationat Using IAM.

    Ways to Access Amazon EC2This guide showed you how to launch and terminate an instance using the AWS Management Console.You can continue using Amazon EC2 through the console, or try one of the other interfaces.

    Continue Using the Console

    The AWS Management Console includes many other functions besides just launching and terminatinginstances.To learn more about how to use Amazon EC2 through the console, go to the Amazon Elastic

    API Version 2013-10-019

    Amazon Elastic Compute Cloud Getting Started Guide

    AWS Account and Security Credentials

    http://aws.amazon.com/iamhttp://docs.aws.amazon.com/IAM/latest/UserGuide/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/http://docs.aws.amazon.com/IAM/latest/UserGuide/http://aws.amazon.com/iam
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    14/19

    Compute Cloud User Guide. The console also has online Help to assist you; just click the Helpbutton inthe console.

    Use the Command Line Interface

    To get started with Amazon EC2's Java-based command line interface, go to the Setting Up the CommandLine Tools in the Amazon Elastic Compute Cloud User Guide. These command line tools are a fast wayto use EC2 without coding to the API or using a library.

    Use an Existing Library

    If you prefer to use Amazon EC2 through a programmatic interface, there are libraries and resourcesavailable for the following languages:

    Java

    PHP

    Python

    Ruby

    Windows and .NET

    For libraries and sample code in all languages, go to Amazon EC2 Sample Code & Libraries.

    Code Directly to the Web Service API

    If you want to write code directly to the Amazon EC2 Query API, go to Making API Requestsin the AmazonElastic Compute Cloud User Guide.You'll learn how to create and authenticate API requests, and howto use Amazon EC2 through the API actions. For a complete description of the API actions, see theAmazon Elastic Compute Cloud API Reference.

    Designing Your Application for the CloudAWS solutions architects and evangelists created white papers to help you design your application sothat it's fault tolerant, scalable, and elastic. For more information, go to AWS Cloud Computing Whitepapers.

    Learn More about Amazon EC2The following are additional features of Amazon EC2.

    Amazon Virtual Private Cloud

    You can use Amazon EC2 with Amazon Virtual Private Cloud, a service that enables you to create anisolated portion of the AWS cloud called a VPC. With Amazon VPC, you can create a virtual networktopologyincluding subnets and route tablesfor your EC2 resources. For more information, go to theAmazon VPC product pageand the Amazon Virtual Private Cloud User Guide.

    Creating Your Own AMIs

    Amazon and other reputable sources offer AMIs that you can launch. However, you might want to createyour own custom AMIs.You can modify instances of Amazon AMIs or other reputable public AMIs as

    API Version 2013-10-0110

    Amazon Elastic Compute Cloud Getting Started Guide

    Use the Command Line Interface

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/http://aws.amazon.com/java/http://aws.amazon.com/php/http://aws.amazon.com/python/http://aws.amazon.com/ruby/http://aws.amazon.com/net/http://aws.amazon.com/code/Amazon%20EC2http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/available-apis.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/APIReference/http://aws.amazon.com/whitepapershttp://aws.amazon.com/vpchttp://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/http://aws.amazon.com/vpchttp://aws.amazon.com/whitepapershttp://docs.aws.amazon.com/AWSEC2/latest/APIReference/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/available-apis.htmlhttp://aws.amazon.com/code/Amazon%20EC2http://aws.amazon.com/net/http://aws.amazon.com/ruby/http://aws.amazon.com/python/http://aws.amazon.com/php/http://aws.amazon.com/java/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    15/19

    needed and create your own custom AMIs from them. For general information about AMIs, go to AMIsand to Creating Your Own AMIsin the Amazon Elastic Compute Cloud User Guide.

    You can choose between Amazon S3 or Amazon Elastic Block Store as the root device for your AMI (fora brief description of Amazon EBS, see Amazon Elastic Block Store (p. 12)later in this section). Werecommend using instances backed by Amazon EBS, because they launch faster and use persistent

    storage. For more information, go to AMIs Backed by Amazon EBSin the Amazon Elastic Compute CloudUser Guide.

    Importing Your Own Virtual Machines

    You can import a virtual machine or volume from your own data center into Amazon EC2. For moreinformation, go to Importing Your Virtual Machines and Volumes into Amazon EC2in the Amazon ElasticCompute Cloud User Guide.

    Instance Types

    To meet the needs of different organizations and applications, Amazon EC2 instances are available indifferent sizes and CPU/memory configurations. For more information, go to Instancesin the Amazon

    Elastic Compute Cloud User Guide.

    Tags

    You can add optional metadata to your instances, AMIs, and other EC2 resources to help you categorizeand manage them. For more information, go to Using Tagsin the Amazon Elastic Compute Cloud UserGuide.

    Elastic IP Addresses

    You might want to have static IP addresses for your instances. Amazon EC2 provides elastic IP addressesthat can be dynamically remapped to different instances. For more information, go to Elastic IP Addressesin the Amazon Elastic Compute Cloud User Guide.

    Security Groups

    You might be concerned about keeping others from accessing your instances, both inside and outsidethe Amazon network.You can create other security groups (beyond the basic group we used in this guide)to meet your security requirements. For more information, go to Network Security Conceptsin the AmazonElastic Compute Cloud User Guide.

    Availability Zones

    You might want to build a geographically dispersed, fault tolerant architecture on Amazon EC2.You canplace instances in different geographic regions and isolate instances within those regions using Availability

    Zones.This provides geographic flexibility and affordable fault tolerance. For more information, go toRegion and Availability Zone Conceptsin the Amazon Elastic Compute Cloud User Guide.

    Amazon Linux

    AWS provides Amazon Linux AMIs, which are supported and maintained Linux images optimized for theEC2 environment. For more information, go to Amazon Linux AMI.

    API Version 2013-10-0111

    Amazon Elastic Compute Cloud Getting Started Guide

    Importing Your Own Virtual Machines

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/PreparingAndCreatingAMIs.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Concepts_BootFromEBS.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsInstances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-elastic-addressing.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-security.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-regions-availability-zones.htmlhttp://aws.amazon.com/amazon-linux-ami/http://aws.amazon.com/amazon-linux-ami/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-regions-availability-zones.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-security.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-elastic-addressing.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsInstances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Concepts_BootFromEBS.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/PreparingAndCreatingAMIs.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    16/19

    Amazon EC2 Running Windows

    Amazon EC2 can run Microsoft Windows Server, with or without Microsoft SQL Server. For moreinformation, go to the Amazon EC2 Running Microsoft Windows Server and SQL Server page. Also, goto Instance Families and Typesand look for Windows Instance Types in the Amazon Elastic Compute

    Cloud User Guide.

    Reserved Instances

    You might want to run a set of full-time or nearly full-time instances but also bring down your costs.Amazon EC2 supports an additional pricing option that enables you to make a low one-time payment foreach instance to reserve and receive a significant discount on the hourly usage charge for that instance.For more information, go to On-Demand and Reserved Instancesand toReserving Amazon EC2 Instancesin the Amazon Elastic Compute Cloud User Guide.

    Spot Instances

    If you're flexible about when you need instances and want to bring down your costs, Amazon EC2 lets

    you bid for unused Amazon EC2 capacity and run your instances for as long as your bid exceeds thecurrent Spot Price. For more information, go to the Amazon EC2 Spot Instances product pageandIntroduction to Spot Instances.

    Amazon Elastic Block Store

    You might need more space than is provided on the instance, or you might need a permanent storagesolution. Amazon Elastic Block Store enables you to create volumes that can be mounted as block devicesby Amazon EC2 instances. Amazon EBS volumes behave like raw unformatted external block devices,and they persist past the life of an Amazon EC2 instance. For more information, go to the Amazon ElasticBlock Store product page. Also go to Amazon Elastic Block Storein the Amazon Elastic Compute CloudUser Guide.

    Monitoring InstancesYou might need a solution for monitoring your instances. Amazon CloudWatch is a monitoring servicefor Amazon EC2 that is designed to gather, aggregate, store, and retrieve metrics. For more information,go to the Amazon CloudWatch product pageand the Amazon CloudWatch Developer Guide.

    Load Balancing

    You might need a solution for load balancing requests to your instances. Elastic Load Balancing offersthe ability to evenly spread requests across your running Amazon EC2 instances. For more information,go to the Elastic Load Balancing product pageand the Elastic Load Balancing Developer Guide.

    Automatically Scaling InstancesYou might want to automatically scale up and down the number of instances you use. Auto Scalingenables you to automatically increase or decrease the number of running Amazon EC2 instances inresponse to your web applications usage and the configuration you define. For more information, go tothe Auto Scaling product pageand the Auto Scaling Developer Guide.

    API Version 2013-10-0112

    Amazon Elastic Compute Cloud Getting Started Guide

    Amazon EC2 Running Windows

    http://aws.amazon.com/windows/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-reserved-instances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-reserved-instances.htmlhttp://aws.amazon.com/ec2/spot-instances/http://aws.amazon.com/articles/3260http://aws.amazon.com/ebs/http://aws.amazon.com/ebs/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.htmlhttp://aws.amazon.com/cloudwatchhttp://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/http://aws.amazon.com/elasticloadbalancinghttp://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/http://aws.amazon.com/autoscalinghttp://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/http://aws.amazon.com/autoscalinghttp://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/http://aws.amazon.com/elasticloadbalancinghttp://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/http://aws.amazon.com/cloudwatchhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.htmlhttp://aws.amazon.com/ebs/http://aws.amazon.com/ebs/http://aws.amazon.com/articles/3260http://aws.amazon.com/ec2/spot-instances/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-reserved-instances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.htmlhttp://aws.amazon.com/windows/
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    17/19

    Micro Instances

    Amazon EC2 offers micro instances, which provide a small amount of consistent CPU resources andallow you to burst CPU capacity when additional cycles are available. They are well suited for lowerthroughput applications and web sites that consume significant compute cycles periodically. For more

    information, go to Micro Instance Conceptsin the Amazon Elastic Compute Cloud User Guide.

    Cluster Instances

    Amazon EC2 offers cluster instances for your High-Performance Computing (HPC) applications. Theseinstances provide you with high-bandwidth, low-latency inter-node communications for advancedcomputational applications such as computational fluid dynamics, computational biology, and materialsresearch. For more information, go to Using Cluster Instancesin the Amazon Elastic Compute CloudUser Guide.

    Public Data Sets

    Amazon EC2 provides a repository of public data sets, such as the mapping of the human genome and

    the US census data, that you can seamlessly integrate into your AWS cloud-based applications. For moreinformation, go to the Public Data Sets on AWS page. Also go to Using Public Data Setsin the AmazonElastic Compute Cloud User Guide.

    Amazon EC2 ResourcesThe following table lists related resources that you'll find useful as you work with Amazon EC2.

    DescriptionResource

    A central starting point to find documentation, code samples,release notes, and other information to help you create

    innovative applications using AWS.

    AWS Resources

    A community-based forum for discussing technical questionsrelated to Amazon EC2.

    Amazon EC2 forum

    A high-level overview of the current release.Amazon EC2 Release Notes

    The home page for AWS Technical Support.AWS Support Center

    The primary web page for information about AWS Support,a one-on-one, fast-response support channel to help you buildand run applications on AWS.

    AWS Support

    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.

    Contact Us

    You can also find additional information about Amazon EC2 in the Amazon EC2 Articles & Tutorialsareaof the AWS web site.

    API Version 2013-10-0113

    Amazon Elastic Compute Cloud Getting Started Guide

    Micro Instances

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts_micro_instances.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.htmlhttp://aws.amazon.com/publicdatasets/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-public-data-sets.htmlhttp://aws.amazon.com/resources/https://forums.aws.amazon.com/forum.jspa?forumID=30http://aws.amazon.com/releasenotes/Amazon-EC2https://aws.amazon.com/supporthttp://aws.amazon.com/premiumsupport/http://aws.amazon.com/contact-us/http://aws.amazon.com/articles/Amazon-EC2http://aws.amazon.com/articles/Amazon-EC2http://aws.amazon.com/contact-us/http://aws.amazon.com/premiumsupport/https://aws.amazon.com/supporthttp://aws.amazon.com/releasenotes/Amazon-EC2https://forums.aws.amazon.com/forum.jspa?forumID=30http://aws.amazon.com/resources/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-public-data-sets.htmlhttp://aws.amazon.com/publicdatasets/http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts_micro_instances.html
  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    18/19

    Document History

    The following table describes the important changes to this guide.

    Release DateDescriptionChange

    19 October2012

    We've added a new section that steps you through attaching anAmazon EBS volume to your instance and making it available foruse.

    Structurally, the tutorial pages were consolidated into a single webpage.This web page is also included in the Amazon Elastic ComputeCloud User Guide.

    Explore yourinstance

    5 March 2012You can connect to your Linux instance from your web browser usinga Java-based SSH client.

    Use the NewJava-BasedSSH Client

    The first release of the Amazon Elastic Compute Cloud GettingStarted Guide.

    Public Release

    API Version 2013-10-0114

    Amazon Elastic Compute Cloud Getting Started Guide

  • 8/11/2019 AmazonElasticComputeCloud-Getting Started With EC2

    19/19

    Please Provide Feedback

    Your input is important to help make our documentation helpful and easy to use. Please tell us about

    your experience getting started with Amazon EC2 by completing our Getting Started Survey.

    Thank you.

    API Version 2013-10-0115

    Amazon Elastic Compute Cloud Getting Started Guide

    https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/service_start_survey?service_name=AmazonEC2https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/service_start_survey?service_name=AmazonEC2