Prior to provisioning infrastructure you first need to prepare AMIs for Consul, Vault and Nomad. In each case you will leverage code available from the official modules from the Terraform Module Registry. In all cases, the modules leverage Packer to create Amazon Machine Images (AMIs) that have each product plus Dnsmasq installed on top of Ubuntu 16.04; specifically:
- Consul: install-consul and install-dnsmasq.
- Nomad: install-nomad and install-dnsmasq.
- Vault: install-vault and install-dnsmasq.
These AMIs will have Consul installed and configured to automatically join a cluster during boot-up. They also have Dnsmasq installed and configured to use Consul for DNS lookups of the .consul
domain (e.g. foo.service.consul
).
To build the AMIs:
git clone
this repo to your computer.- Install Packer.
- Configure your AWS credentials using one of the options supported by the AWS SDK. Usually, the easiest option is to set the
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variables. - Update the
./packer/variables.json
configure the AWS region, Consul, Nomad and Vault versions and Consult, Nomad and Vault module versions (fromhttps://registry.terraform.io
). - Run
./packer/build-amis.sh
- When each build finishes, it will output the IDs of the new AMIs, update
consul_ami
,vault_consul_ami
andnomad_consul_ami
in./variables.tf
appropriately.
TODO
./helpers/consul-helper.sh
TODO
./helpers/nomad-helper.sh
TODO
TODO
TODO
./helpers/vault-helper.sh