Creating an Amazon Machine Image
We have already discussed Amazon Machine Image (AMI) while creating EC2 instances. AMI is the most common way to create backup images of an EC2 Instance. For the sake of consistency, while creating an AMI, AWS reboots the instance by default. However, this can be overridden and AMIs can be created without rebooting the EC2 Instance. AMIs store references to device mapping with corresponding volume snapshots. AMIs can be used to define a standard template which can be used while launching EC2 instances. For example, we may want to use a standard flavor of Linux with predefined system configurations across all EC2 instances. We can create an AMI for this and use it while creating EC2 instances.
How to do it…
- We can create an AMI of an existing EC2 Instance using an
ec2_ami
module. In this task we will be creating an AMI from the existing instance which, we created in one of the previous tasks. This task will require the instance id, the option to reboot the...