Packer is a free, open-source application from Hashicorp. It can generate a server image based on an existing one, and configure it for your special needs. You can use the generated image when you launch a server instance in the cloud or on your local workstation.

Place the packer application into the version-specific folder you just created.

Packer script

Packer reads a .json file to generate the new server image.

For Chef in AWS

To allow the Chef Kitchen EC2 driver to read the OS version of the image, include the version in the “Name” as follows:

Windows-2012

Windows-2012r2

Windows-2012r2sp1

RHEL-7.2

Generate the server image with Packer

Open a Bash window,

Navigate to the folder of the Packer JSON script,

Execute the following command. Get the AWS access key and secret key from the ~/.aws/credentials file on your Macintosh or Linux workstation. On Windows, the file is at C:\Users\YOUR_USER_NAME\.aws\credentials.