Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Example of setting up a Consul cluster with Terraform

License

Notifications You must be signed in to change notification settings

spinx/terraform-consul-example

Repository files navigation

terraform-consul-example

Ready to go Consul cluster. From https://medium.com/@spinx/terraforming-aws-setting-up-highly-available-consul-cluster-in-less-than-5min-d1a2524e5882#.t9q20zjey

Dependencies

Pull dependencies

make
ansible-galaxy install -r requirements.yml

Setup

  • Modify credentials.tf with your AWS and Atlas keys. Make sure you don't push this to GitHub!!
  • Add key pair to AWS EC2 and modify key_name in credentials.tf
  • Modify security_groups.tf where commented DANGER with your IP. If you don't do this, your cluster will be publicly accessible and very insecure!

Run

  • terraform plan to see what TF will do
  • terraform apply to set up the cluster

Output

When TF is finished you will get the list of servers that were set up and a Consul Web UI URL.

Troubleshooting

If your AWS account supports EC2 Classic, this won't work for you. You need to specify VPC and Subnet ids to launch the servers in VPC. See here: https://gist.github.com/spinx/047afb19996b91795dd5

About

Example of setting up a Consul cluster with Terraform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published