Initializing Packer

Learn to create an AWS account and install Packer on a virtual machine.

We'll cover the following

When running Packer, we recommend running it on Linux, both for cloud images and Docker images. Windows is a special niche for cloud computing, and Microsoft provides its own sets of tools for handling Windows images. We don't recommend using a Mac for running these, as the move to Apple silicon and the interaction with multiple tools with varying support can lead to a long debug time. While macOS is POSIX-compliant, it still isn't Linux, the main target of these tools.

User setup

Getting an AWS account set up with a Linux VM and setting up user accounts is beyond what we can cover in the course. See the AWS documentation for help with that. For this exercise, please choose either an Amazon Linux or Ubuntu distribution.

User setup is done using AWS IAM tools, and the user name can be whatever you choose. You will also need to obtain an access key and secret for this user. Do not store these in a repository or any place that is publicly accessible, as they are equivalent to a username/password. The user will need to do the following:

  • Belong to a group with AdministratorAccess permissions set.

  • Attach the existing policy, AmazonSSMAutomationRole.

Note: We recommend a personal account for this exercise, as this access is quite extensive. You can also set up a specific set of permissions or use another method that isn't as permissible. Instructions on those methods can be found here on the Packer documentation.

Setting up

Once we are logged into the VM, we need to install Packer. This is going to depend on what Linux version we have.

The following is for Amazon Linux:

Get hands-on with 1200+ tech skills courses.