Packer template for generating an AMI running Hashicorp's Consul.
Specifically, the template builds an AMI based on the Ubuntu 16.04 base image that runs a Consul server instance.
The created image requires additional configuration in order to run. Notably:
- The
bootstrap_expectorbootstrapparameter must be set. - To listen on addresses other than
localhost, theclient_addrparameter must be set.
To accomplish this, create a file in the /opt/consul/config directory with the desired options. One solution for this is to use the user data parameters available when launching an EC2 instance.
This repository is configured to create an image named consul-server-<consul version>-<timestamp>. This can be used in Terraform through the following:
data "aws_ami" "consul-server" {
most_recent = true
owner = ["self"]
filter {
name = "name"
values = ["consul-server-*"]
}
}This project is licensed under the MIT License. More information can be found in the LICENSE file.