https://github.com/trackit/ec2-hashicorp-tutorial
Supporting repository for a blog article
https://github.com/trackit/ec2-hashicorp-tutorial
Last synced: 4 months ago
JSON representation
Supporting repository for a blog article
- Host: GitHub
- URL: https://github.com/trackit/ec2-hashicorp-tutorial
- Owner: trackit
- Created: 2017-09-26T15:51:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-30T07:37:56.000Z (over 8 years ago)
- Last Synced: 2025-09-10T17:03:01.403Z (9 months ago)
- Language: HCL
- Size: 11.7 KB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= Tutorial: Hashicorp Suite with EC2
This is the accompanying repository for this article on the Trackit blog:
https://blog.trackit.io/ec2-hashicorp-1/. It contains Terraform and Packer
specifications which can build a minimal EC2 cluster with service discovery and
automated job placement using Consul and Nomad.
== Build the AMIs
In order to build the AMIs you will need to have _Packer_ installed. With that
done, you can go to _/packer/master/_ and _/packer/slave/_ and simply run
`packer build packer.json`.
Make sure to take note of the IDs for the AMIs you built.
== Deploy the infrastructure
You need an AWS account with admin access to deploy the infrastructure. First
edit _/terraform/amis.tf_, adding the AMI IDs you got from building the AMIs
with Packer. Also place your public SSH key in _/terraform/ssh.pub_ so you can
later SSH into your instances with the user `admin`.
Then run `terraform plan -out tf.plan`, make sure it doesn’t plan on doing
something Terraform shouldn’t do, and run `terraform apply tf.plan`. In just a
few minutes you should get a fault-resistant setup where _Consul_ handles
service discovery and _Nomad_ manages your tasks by placing them on the slave
instances in an efficient manner.