Building the solution
With our design in place, all we need to do is write the code that implements the design.
Packer
Our solution has a frontend and a backend application component. Although the application code is radically different, the way we build a VM image is not.
AWS plugin
As we discussed in Chapter 4, Packer – like Terraform – is an extensible command-line executable. Each cloud platform provides a plugin for Packer that encapsulates the integration with its services:
packer {
required_plugins {
amazon = {
source = “github.com/hashicorp/amazon”
version = “~> 1.2.6”
}
}
} Plugins need to be declared within a Packer solution. At the time of writing, the latest version of the AWS Packer plugin is 1.2.6.
The AWS plugin for Packer provides an amazon-ebs builder that will generate an AMI by creating a new VM from a base image, executing the provisioners, taking an Elastic Block Store (EBS...