Template

In the builders section of the template, we define our build details.

We are using the most common type of AMI builder: amazon-ebs. There are other types of AWS builders available too, for instance, storage-backed instance types.

Next, we define the type of instance to use when baking.

Make sure that you can decrease the time it takes to bake your instance by using a larger instance size. Remember that the minimum price paid for an instance is one hour of billable time.

The source_ami property in this recipe is an AWS Linux AMI ID in the region we have specified. ssh_username allows you to set the username that's used to connect and run provisioners on the instance. This will be determined by your operating system, which, in our case, is ec2-user.

Finally, the ami_name field includes the built-in packer variable called {{timestamp}}. This ensures the AMI you create will always have a unique name.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset