[/] Install packer binary
[/] Verify the Installation
[/] Build an Image
--- [/] Create Template
- Used example template from Learn Docs
- named it example.pkr.hcl
--- [/] Verify Template
--- [/] Build First Image with AWS EC2 AMI
- Using the packer build command, my first image with AWS EC2 was born.
--- [/] Learn How to Manage Image
[/] Provision
--- [/] Configure Provisioners
--- [/] Launch AMI
A machine image stores all the configuration you want to help create a virtual machine (VM) instance.
With machine images, you can take a snapshot of your web application and save it to a unique machine image. You can then use that machine image to launch multiple instances that are configured in the exact same way as your source instance.
Packer is a Hashicrop IaC tool that makes automating machine image creation easy. Encourages automation of scripts to install and configure software within Packer-made images with unique machine image IDs.
- During the "Verify Template" stage, I ran into an issue with the example template from Learn Docs. The issue was with two specific lines. Since the credentials are already set via an
.aws/credentials
file, these lines have been commented out of the example.pkr.hcl template file. After removing these lines, packer was able to verify the template.
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"