Amazon Elastic Compute Cloud User Guide for Linux API Version 2015-04-15 Amazon Elastic Compute Cloud User Guide for Linux
Total Page:16
File Type:pdf, Size:1020Kb
Amazon Elastic Compute Cloud User Guide for Linux API Version 2015-04-15 Amazon Elastic Compute Cloud User Guide for Linux Amazon Elastic Compute Cloud: User Guide for Linux Copyright © 2015 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, AWS CloudTrail, AWS CodeDeploy, Amazon Cognito, Amazon DevPay, DynamoDB, ElastiCache, Amazon EC2, Amazon Elastic Compute Cloud, Amazon Glacier, Amazon Kinesis, Kindle, Kindle Fire, AWS Marketplace Design, Mechanical Turk, Amazon Redshift, Amazon Route 53, Amazon S3, Amazon VPC, and Amazon WorkDocs. In addition, Amazon.com graphics, logos, page headers, button icons, scripts, and service names are trademarks, or trade dress of Amazon in the U.S. and/or other countries. Amazon©s trademarks and trade dress may not be used in connection with any product or service that is not Amazon©s, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon Elastic Compute Cloud User Guide for Linux Table of Contents What Is Amazon EC2? ................................................................................................................... 1 Features of Amazon EC2 ........................................................................................................ 1 How to Get Started with Amazon EC2 ....................................................................................... 2 Related Services ................................................................................................................... 2 Accessing Amazon EC2 ......................................................................................................... 3 Pricing for Amazon EC2 ......................................................................................................... 4 Instances and AMIs ............................................................................................................... 4 Instances ..................................................................................................................... 5 AMIs ........................................................................................................................... 6 Regions and Availability Zones ................................................................................................ 7 Region and Availability Zone Concepts .............................................................................. 7 Describing Your Regions and Availability Zones .................................................................. 9 Specifying the Region for a Resource .............................................................................. 11 Launching Instances in an Availability Zone ...................................................................... 12 Migrating an Instance to Another Availability Zone ............................................................. 13 Root Device Volume ............................................................................................................. 14 Root Device Storage Concepts ...................................................................................... 14 Choosing an AMI by Root Device Type ............................................................................ 16 Determining the Root Device Type of Your Instance ............................................................ 17 Changing the Root Device Volume to Persist .................................................................... 17 Setting Up .................................................................................................................................. 20 Sign Up for AWS ................................................................................................................. 20 Create an IAM User ............................................................................................................. 21 Create a Key Pair ................................................................................................................ 22 Create a Virtual Private Cloud (VPC) ....................................................................................... 23 Create a Security Group ....................................................................................................... 24 Getting Started ............................................................................................................................ 26 Step 1: Launch an Instance ................................................................................................... 27 Step 2: Connect to Your Instance ............................................................................................ 28 Option 1: Connect Using Your Browser ............................................................................ 29 Option 2: Connect from Windows Using PuTTY ................................................................. 30 Option 3: Connect from Mac or Linux Using an SSH Client .................................................. 31 Step 3: Add a Volume ........................................................................................................... 31 Step 4: Clean Up ................................................................................................................. 34 Best Practices ............................................................................................................................. 36 Tutorial: Installing a LAMP Web Server on Amazon Linux .................................................................... 38 Tutorial: Hosting a WordPress Blog ................................................................................................. 44 Install WordPress ................................................................................................................. 44 Next Steps ......................................................................................................................... 52 Help! My Public DNS Name Changed and now my Blog is Broken ................................................ 52 Amazon Machine Images .............................................................................................................. 54 Using an AMI ...................................................................................................................... 54 Creating Your Own AMI ......................................................................................................... 55 Buying, Sharing, and Selling AMIs .......................................................................................... 55 Deregistering Your AMI ......................................................................................................... 55 Amazon Linux ..................................................................................................................... 55 AMI Types .......................................................................................................................... 56 Launch Permissions ..................................................................................................... 56 Storage for the Root Device ........................................................................................... 56 Virtualization Types .............................................................................................................. 59 Finding a Linux AMI ............................................................................................................. 60 Finding a Linux AMI Using the Amazon EC2 Console ......................................................... 60 Finding an AMI Using the AWS CLI ................................................................................. 61 Finding an AMI Using the Amazon EC2 CLI ..................................................................... 61 Shared AMIs ....................................................................................................................... 62 API Version 2015-04-15 iii Amazon Elastic Compute Cloud User Guide for Linux Finding Shared AMIs .................................................................................................... 62 Making an AMI Public ................................................................................................... 65 Sharing an AMI with Specific AWS Accounts .................................................................... 66 Using Bookmarks ........................................................................................................ 68 Guidelines for Shared Linux AMIs ................................................................................... 68 Paid AMIs ........................................................................................................................... 72 Selling Your AMI .......................................................................................................... 73 Finding a Paid AMI ....................................................................................................... 73 Purchase a Paid AMI .................................................................................................... 74 Getting the Product Code for Your Instance .....................................................................