Using Packer to create Amazon Machine Images

The vfarcic/cloud-provisioning (https://github.com/vfarcic/cloud-provisioning) repository already has the Packer and Terraform configurations we'll use. They are located in the terraform/aws directory:

cd terraform/aws

The first step is to use Packer to create an Amazon Machine Image (AMI). To do that, we'll need AWS access keys set as environment variables. They will be the same as those you already created in this chapter. Feel free to skip the next set of commands if you still have the same terminal session open:

export AWS_ACCESS_KEY_ID=[...]export AWS_SECRET_ACCESS_KEY=[...]export AWS_DEFAULT_REGION=us-east-1

Please replace [...] with the actual values.

We'll instantiate all Swarm nodes ...

Get The DevOps 2.1 Toolkit: Docker Swarm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.