|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
Now that we have customized our Amazon EC2 instance, we can save this Amazon Machine Image (AMI) and launch future environments with this saved configuration using AWS CloudFormation. This is an optional step. If you prefer to finish the tutorial now, you can skip ahead to clean up your AWS resources in Step 12: Clean Up.
To create an AMI from a running Amazon EBS-backed instance
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
Make sure that US East (N. Virginia) is selected in the region selector of the navigation bar.
Click Instances in the navigation pane.
On the Instances page, right-click your running instance and select Create Image.
Fill in a unique image name and an optional description of the image (up to 255 characters), and click Create Image.
If you're familiar with Amazon EC2 instance store-backed AMIs, the image name replaces the manifest name (e.g., s3_bucket/something_of_your_choice.manifest.xml), which uniquely identifies each Amazon Amazon EC2 instance store-backed AMI.
Amazon EC2 powers down the instance, takes images of any volumes that were attached, creates and registers the AMI, and then reboots the instance.
Go to the AMIs page and view the AMI's status. While the new AMI is being created, its status is pending.
It takes a few minutes for the whole process to finish.
Once your new AMI's status is available, go to the Snapshots page and view the new snapshot that was created for the new AMI. Any instance you launch from the new AMI uses this snapshot for its root device volume. You could update your Auto Scaling group with the new AMI, however we will do this as part of the AWS CloudFormation step.
We've taken a lot of steps so far to create all of our AWS resources, deploy our application, and customize our AMI. Wouldn't it be great if we could save all of this information and launch new environments without having to manually configure everything again? We can! AWS CloudFormation is a way to launch environments easily. That is, when you launch an AWS CloudFormation environment, you are able to launch specific AMIs with particular key pairs, on pre-defined instance sizes, and behind load balancers. And if any portion of your environment fails to launch, the environment rolls itself back, terminating all the pieces along the way. Let's move on to the next topic to begin using AWS CloudFormation.