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, for instance, storage-backed instance types.
Next, we define the type of instance to use when baking.
Make sure that you can often 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. The ssh_username allows you to set the username 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 {{timestamp}}. This ensures the AMI you create will always have a unique name.