Repo Browser: HashiCorp Consul You need to enable JavaScript to run this app.
Gruntwork Website
HashiCorp Consul Deploy a Consul cluster. Supports automatic bootstrapping, DNS, Consul UI, and auto healing.
Consul AWS Module
This repo contains a set of modules in the modules folder for deploying a Consul cluster on
AWS using Terraform . Consul is a distributed, highly-available
tool that you can use for service discovery and key/value storage. A Consul cluster typically includes a small number
of server nodes, which are responsible for being part of the consensus
quorum , and a larger number of client nodes, which you typically
run alongside your apps:
How to use this Module
This repo has the following folder structure:
modules : This folder contains several standalone, reusable, production-grade modules that you can use to deploy Consul.
examples : This folder shows examples of different ways to combine the modules in the modules
folder to deploy Consul.
test : Automated tests for the modules and examples.
root folder : The root folder is an example of how to use the consul-cluster module
module to deploy a Consul cluster in AWS . The Terraform Registry requires the root of every repo to contain Terraform code, so we've put one of the examples there. This example is great for learning and experimenting, but for production use, please use the underlying modules in the modules folder directly.
To deploy Consul servers for production using this repo:
Create a Consul AMI using a Packer template that references the install-consul module .
Here is an example Packer template .
If you are just experimenting with this Module, you may find it more convenient to use one of our official public AMIs:
WARNING! Do NOT use these AMIs in your production setup. In production, you should build your own AMIs in your own
AWS account.
Deploy that AMI across an Auto Scaling Group using the Terraform consul-cluster module
and execute the run-consul script with the --server
flag during boot on each
Instance in the Auto Scaling Group to form the Consul cluster. Here is an example Terraform
configuration to provision a Consul cluster.
To deploy Consul clients for production using this repo:
Use the install-consul module to install Consul alongside your application code.
Before booting your app, execute the run-consul script with --client
flag.
Your app can now use the local Consul agent for service discovery and key/value storage.
Optionally, you can use the install-dnsmasq module for Ubuntu 16.04 and Amazon Linux 2 or setup-systemd-resolved for Ubuntu 18.04 to configure Consul as the DNS for a
specific domain (e.g. .consul
) so that URLs such as foo.service.consul
resolve automatically to the IP
address(es) for a service foo
registered in Consul (all other domain names will be continue to resolve using the
default resolver on the OS).
What's a Module?
A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such
as a database or server cluster. Each Module is created using Terraform , and
includes automated tests, examples, and documentation. It is maintained both by the open source community and
companies that provide commercial support.
Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse
existing code that has been proven in production. And instead of maintaining all that infrastructure code yourself,
you can leverage the work of the Module community to pick up infrastructure improvements through
a version number bump.
Who maintains this Module?
This Module is maintained by Gruntwork . If you're looking for help or commercial
support, send an email to modules@gruntwork.io .
Gruntwork can help with:
Setup, customization, and support for this Module.
Modules for other types of infrastructure, such as VPCs, Docker clusters, databases, and continuous integration.
Modules that meet compliance requirements, such as HIPAA.
Consulting & Training on AWS, Terraform, and DevOps.
Code included in this Module:
install-consul : This module installs Consul using a
Packer template to create a Consul
Amazon Machine Image (AMI) .
consul-cluster : The module includes Terraform code to deploy a Consul AMI across an Auto
Scaling Group .
run-consul : This module includes the scripts to configure and run Consul. It is used
by the above Packer module at build-time to set configurations, and by the Terraform module at runtime
with User Data
to create the cluster.
install-dnsmasq module : Install Dnsmasq
for Ubuntu 16.04 and Amazon Linux 2 and configure it to forward requests for a specific domain to Consul. This allows you to use Consul as a DNS server
for URLs such as foo.service.consul
.
setup-systemd-resolved module : Setup systemd-resolved
for ubuntu 18.04 and configure it to forward requests for a specific domain to Consul. This allows you to use Consul as a DNS server
for URLs such as foo.service.consul
.
consul-iam-policies : Defines the IAM policies necessary for a Consul cluster.
consul-security-group-rules : Defines the security group rules used by a
Consul cluster to control the traffic that is allowed to go in and out of the cluster.
consul-client-security-group-rules : Defines the security group rules
used by a Consul agent to control the traffic that is allowed to go in and out.
How do I contribute to this Module?
Contributions are very welcome! Check out the Contribution Guidelines for instructions.
How is this Module versioned?
This Module follows the principles of Semantic Versioning . You can find each new release,
along with the changelog, in the Releases Page .
During initial development, the major version will be 0 (e.g., 0.x.y
), which indicates the code does not yet have a
stable API. Once we hit 1.0.0
, we will make every effort to maintain a backwards compatible API and use the MAJOR,
MINOR, and PATCH versions on each release to indicate any incompatibilities.
License
This code is released under the Apache 2.0 License. Please see LICENSE and NOTICE for more
details.
Copyright © 2017 Gruntwork, Inc.
Questions? Ask away. We're here to talk about our services, answer any questions, give advice, or just to chat.
Ready to hand off the Gruntwork? "https://cdn.gruntwork.io/gruntwork-website/"
{"index":{"js":"https://cdn.gruntwork.io/gruntwork-website/index.bundle.c7884255553b53fbca3a.js","map":"https://cdn.gruntwork.io/gruntwork-website/index.bundle.1b14c1b7d19f1f5eb35d6e118e838255.map"},"styles":{"css":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.f22938926651ddec7c49.css","js":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.e782420e74a20dcb8691.js","map":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.d5e2af49807c6ca33f8367d621ece507.map"},"vendors":{"css":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.29f7d0366a0978763f96.css","js":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.fa8174a130797d75d12c.js","map":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.57243d94deeeb29d5061288a338b4eb6.map"}}
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"b602d607e34a3cbef8c7f766d18369841efbb89a"}]},{"name":".gitignore","path":".gitignore","sha":"866fba08567d4c22683017421abdb60f985833f2"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"4be01a6334d39aa5bf6abe6baae701f5e2a8c5ac"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","sha":"bdfb309d7ff6bb05ffc1ea9453604805c022d13b"},{"name":"LICENSE","path":"LICENSE","sha":"7a4a3ea2424c09fbe48d455aed1eaa94d9124835"},{"name":"NOTICE","path":"NOTICE","sha":"9f6aed2a3cc04e4ef63c90448b2f0ac07378b270"},{"name":"README.md","path":"README.md","sha":"2f70405c336d19685c495170b103691ed604b300","toggled":true},{"name":"_ci","children":[{"name":"publish-amis-in-new-account.md","path":"_ci/publish-amis-in-new-account.md","sha":"5b5daa55c3e36c1c4739471be92ccb53995f9783"},{"name":"publish-amis.sh","path":"_ci/publish-amis.sh","sha":"e575763ccd2158e49f3b5c53aad2b8f197992260"}]},{"name":"_docs","children":[{"name":"amazon-linux-ami-list.md","path":"_docs/amazon-linux-ami-list.md","sha":"fc523855ab81d4958d77179a64e3bb7d10782664"},{"name":"architecture.png","path":"_docs/architecture.png","sha":"539fece6e8a9fd7a56245e2b63e6640a1e0591ef"},{"name":"consul-ui-screenshot.png","path":"_docs/consul-ui-screenshot.png","sha":"622c7e70d3ab805b1bb8e27e474ff8243d4bc994"},{"name":"package-managers.md","path":"_docs/package-managers.md","sha":"f382b6997245e03adba61c02346519a70ee016d4"},{"name":"ubuntu16-ami-list.md","path":"_docs/ubuntu16-ami-list.md","sha":"b551779a9941362909d3f5d76fe709e52f02067e"}]},{"name":"examples","children":[{"name":"README.md","path":"examples/README.md","sha":"8eca7399ca356c90a307206147362bc35588179c"},{"name":"consul-ami","children":[{"name":"README.md","path":"examples/consul-ami/README.md","sha":"2b71fb3d7a4cd4176ece97a50a859e8106ebcd5a"},{"name":"consul.json","path":"examples/consul-ami/consul.json","sha":"0cbaaf8e0ce8509414ba1caee19997980f39faf7"}]},{"name":"consul-examples-helper","children":[{"name":"README.md","path":"examples/consul-examples-helper/README.md","sha":"296f6878fd49edb27d6a6b62fa4119b6a407ba26"},{"name":"consul-examples-helper.sh","path":"examples/consul-examples-helper/consul-examples-helper.sh","sha":"fa9beba847bff2270703632a526ffbeb2070974c"}]},{"name":"example-with-custom-asg-role","children":[{"name":"README.md","path":"examples/example-with-custom-asg-role/README.md","sha":"fa1fbb9d7416fa96f13afb6b82664bbe1638ea3f"},{"name":"main.tf","path":"examples/example-with-custom-asg-role/main.tf","sha":"ed53539e6440f8b9a0b951c78b90270409daf07b"},{"name":"outputs.tf","path":"examples/example-with-custom-asg-role/outputs.tf","sha":"347e121901e654df4aaabe434af02c7ced60c051"},{"name":"user-data-client.sh","path":"examples/example-with-custom-asg-role/user-data-client.sh","sha":"fd0158b0287de6bf2a6956718c7aa802076fe489"},{"name":"user-data-server.sh","path":"examples/example-with-custom-asg-role/user-data-server.sh","sha":"c78ebc05584513fa04f44d44ef2b9d17c98e2ea6"},{"name":"variables.tf","path":"examples/example-with-custom-asg-role/variables.tf","sha":"a7f5025a21c9252bdb592a852bf485a426bc9347"}]},{"name":"example-with-encryption","children":[{"name":"README.md","path":"examples/example-with-encryption/README.md","sha":"0f2de7374cf63ee0b18cae4b960b85ec88403866"},{"name":"main.tf","path":"examples/example-with-encryption/main.tf","sha":"90b3095339a0ac6234c4165412534025ffe5e403"},{"name":"outputs.tf","path":"examples/example-with-encryption/outputs.tf","sha":"347e121901e654df4aaabe434af02c7ced60c051"},{"name":"packer","children":[{"name":"README.md","path":"examples/example-with-encryption/packer/README.md","sha":"b7b8ca11120c5f69565dab81eeeed659223538e9"},{"name":"ca.crt.pem","path":"examples/example-with-encryption/packer/ca.crt.pem","sha":"c41779f19be6d742d10be51d80c29aa5d41a660c"},{"name":"consul-with-certs.json","path":"examples/example-with-encryption/packer/consul-with-certs.json","sha":"2a3b298a526ab2bb5abbd91f7ac513a528ff57b8"},{"name":"consul.crt.pem","path":"examples/example-with-encryption/packer/consul.crt.pem","sha":"4a4ea11b89006f41fe2cb8b707d62463bb739184"},{"name":"consul.key.pem","path":"examples/example-with-encryption/packer/consul.key.pem","sha":"b7de428c63382b087007a236602797cc0a0a45f5"}]},{"name":"user-data-client.sh","path":"examples/example-with-encryption/user-data-client.sh","sha":"2ab3735d96777ce9324bc55f7be29c338ef0c1bb"},{"name":"user-data-server.sh","path":"examples/example-with-encryption/user-data-server.sh","sha":"5e97fc02da696b348ee26a2c1803bf7e3e018c79"},{"name":"variables.tf","path":"examples/example-with-encryption/variables.tf","sha":"2f741e848bd95f3d7798f4fd52021ddfdb30d3bd"}]},{"name":"root-example","children":[{"name":"README.md","path":"examples/root-example/README.md","sha":"6c562cb22c28cc5e35b5a21a94b66d6af9101081"},{"name":"user-data-client.sh","path":"examples/root-example/user-data-client.sh","sha":"fd0158b0287de6bf2a6956718c7aa802076fe489"},{"name":"user-data-server.sh","path":"examples/root-example/user-data-server.sh","sha":"c78ebc05584513fa04f44d44ef2b9d17c98e2ea6"}]}]},{"name":"main.tf","path":"main.tf","sha":"ce92b8206ed5e2be29d5e877235dca412bfdb47a"},{"name":"modules","children":[{"name":"README.md","path":"modules/README.md","sha":"8eca7399ca356c90a307206147362bc35588179c"},{"name":"consul-client-security-group-rules","children":[{"name":"README.md","path":"modules/consul-client-security-group-rules/README.md","sha":"777b679a73df3d5c96fb584176e91449c3a72615"},{"name":"main.tf","path":"modules/consul-client-security-group-rules/main.tf","sha":"a90c7a072a8d939094a0171f03520b22986a72d2"},{"name":"variables.tf","path":"modules/consul-client-security-group-rules/variables.tf","sha":"c9c25d00fdc683748570ba5e2ee718c9af8e6697"}]},{"name":"consul-cluster","children":[{"name":"README.md","path":"modules/consul-cluster/README.md","sha":"b9a3c55973ef27b0022f5eda05840f7cc65cea03"},{"name":"main.tf","path":"modules/consul-cluster/main.tf","sha":"ef8e3e819c481fde0ff65c90ae6a3efe99ac30d0"},{"name":"outputs.tf","path":"modules/consul-cluster/outputs.tf","sha":"a980d658e1be410a013a7e7febcc38a49899ffdc"},{"name":"variables.tf","path":"modules/consul-cluster/variables.tf","sha":"f3b4dcad2f1d02a179d25c7cc63e8e5d2c62da11"}]},{"name":"consul-iam-policies","children":[{"name":"README.md","path":"modules/consul-iam-policies/README.md","sha":"7725295fbdbf3d2fe881796e63074e3215854f5f"},{"name":"main.tf","path":"modules/consul-iam-policies/main.tf","sha":"815931541fb65a51755fd053e0e5f264eaf14111"},{"name":"variables.tf","path":"modules/consul-iam-policies/variables.tf","sha":"1bda7959f19ea4ab20108ec9fb8802036bfd22fd"}]},{"name":"consul-security-group-rules","children":[{"name":"README.md","path":"modules/consul-security-group-rules/README.md","sha":"315155181f5b42ff0fc6f16b86eaa930811366fe"},{"name":"main.tf","path":"modules/consul-security-group-rules/main.tf","sha":"6eb9aa2bbd44923f048f5e582b1d301571be4fbc"},{"name":"variables.tf","path":"modules/consul-security-group-rules/variables.tf","sha":"b9f5fe2bd11994d2d8eeb932db8650b43c47add1"}]},{"name":"install-consul","children":[{"name":"README.md","path":"modules/install-consul/README.md","sha":"1d451e16e08a4f6259cb3ee643e39d6171d5a4d9"},{"name":"install-consul","path":"modules/install-consul/install-consul","sha":"476e0e67cac0bcc3561114dd50d0cc8f383086db"}]},{"name":"install-dnsmasq","children":[{"name":"README.md","path":"modules/install-dnsmasq/README.md","sha":"80f0d44b7c7e916821ec8fd624d624f16eb2cb20"},{"name":"install-dnsmasq","path":"modules/install-dnsmasq/install-dnsmasq","sha":"a2b23000018ed0bb4265f137219cea939c851306"}]},{"name":"run-consul","children":[{"name":"README.md","path":"modules/run-consul/README.md","sha":"0b990a784db0354a8bd0401c8a64033765e01c05"},{"name":"run-consul","path":"modules/run-consul/run-consul","sha":"204fcdff91cbdabb8c4166e213e400bf8140d543"}]},{"name":"setup-systemd-resolved","children":[{"name":"README.md","path":"modules/setup-systemd-resolved/README.md","sha":"92a5fb39c0eabefcfc84f20ebe7a994156774fc0"},{"name":"setup-systemd-resolved","path":"modules/setup-systemd-resolved/setup-systemd-resolved","sha":"d81c2bf0966dd1d1a1a97fc24c5862048b05b2cd"}]}]},{"name":"outputs.tf","path":"outputs.tf","sha":"347e121901e654df4aaabe434af02c7ced60c051"},{"name":"test","children":[{"name":"README.md","path":"test/README.md","sha":"874818e6da7a9c0c9338edde0c27fa3f8a3b3d05"},{"name":"aws_helpers.go","path":"test/aws_helpers.go","sha":"867034abaf29d9c6e641daa9c4a51a8286ffb0ed"},{"name":"consul_cluster_test.go","path":"test/consul_cluster_test.go","sha":"179f09e027f87ee8b94debdd0a01a610708cc4b4"},{"name":"consul_cluster_with_custom_asg_role_test.go","path":"test/consul_cluster_with_custom_asg_role_test.go","sha":"96595f03771d0bb27d07ac9739284a9190be3530"},{"name":"consul_cluster_with_encryption_test.go","path":"test/consul_cluster_with_encryption_test.go","sha":"2149dd3a2eb3a0fbab52b17db8d0c18970df5d72"},{"name":"consul_enterprise_test.go","path":"test/consul_enterprise_test.go","sha":"6632f0529b899a314093b489335233108af86d21"},{"name":"consul_helpers.go","path":"test/consul_helpers.go","sha":"da283d181716a2dd127e6b6ebf2bdb3a46f52539"},{"name":"go.mod","path":"test/go.mod","sha":"34184d187f97882ff6ff03b5f22886d2625a7c59"},{"name":"go.sum","path":"test/go.sum","sha":"d0bb4149e83152c6ac5576e0258eb3ef5925bebf"},{"name":"terratest_helpers.go","path":"test/terratest_helpers.go","sha":"cfe73dfea67dc40877e7df715c73dda501e614fd"}]},{"name":"variables.tf","path":"variables.tf","sha":"a2ab5424fac8bd42c8e48a9073ec2e1a403d5db3"}]},"detailsContent":"<p><a href=\"https://gruntwork.io/?ref=repo_aws_consul\" class=\"preview__body--description--blue\" target=\"_blank\"><img src=\"https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg\" alt=\"Maintained by Gruntwork.io\" class=\"preview__body--diagram\"></a></p>\n<h1 class=\"preview__body--title\" id=\"consul-aws-module\">Consul AWS Module</h1><div class=\"preview__body--border\"></div><p>This repo contains a set of modules in the <a href=\"/repos/v0.7.10/terraform-aws-consul/modules\" class=\"preview__body--description--blue\">modules folder</a> for deploying a <a href=\"https://www.consul.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Consul</a> cluster on\n<a href=\"https://aws.amazon.com/\" class=\"preview__body--description--blue\" target=\"_blank\">AWS</a> using <a href=\"https://www.terraform.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Terraform</a>. Consul is a distributed, highly-available\ntool that you can use for service discovery and key/value storage. A Consul cluster typically includes a small number\nof server nodes, which are responsible for being part of the <a href=\"https://www.consul.io/docs/internals/consensus.html\" class=\"preview__body--description--blue\" target=\"_blank\">consensus\nquorum</a>, and a larger number of client nodes, which you typically\nrun alongside your apps:</p>\n<p><img src=\"/repos/images/v0.7.10/terraform-aws-consul/_docs/architecture.png?raw=true\" alt=\"Consul architecture\" class=\"preview__body--diagram\"></p>\n<h2 class=\"preview__body--subtitle\" id=\"how-to-use-this-module\">How to use this Module</h2>\n<p>This repo has the following folder structure:</p>\n<ul>\n<li><a href=\"/repos/v0.7.10/terraform-aws-consul/modules\" class=\"preview__body--description--blue\">modules</a>: This folder contains several standalone, reusable, production-grade modules that you can use to deploy Consul.</li>\n<li><a href=\"/repos/v0.7.10/terraform-aws-consul/examples\" class=\"preview__body--description--blue\">examples</a>: This folder shows examples of different ways to combine the modules in the <code>modules</code> folder to deploy Consul.</li>\n<li><a href=\"/repos/v0.7.10/terraform-aws-consul/test\" class=\"preview__body--description--blue\">test</a>: Automated tests for the modules and examples.</li>\n<li><a href=\"/repos/v0.7.10/terraform-aws-consul\" class=\"preview__body--description--blue\">root folder</a>: The root folder is <em>an example</em> of how to use the <a href=\"/repos/v0.7.10/terraform-aws-consul/modules/consul-cluster\" class=\"preview__body--description--blue\">consul-cluster module</a>\nmodule to deploy a <a href=\"https://www.consul.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Consul</a> cluster in <a href=\"https://aws.amazon.com/\" class=\"preview__body--description--blue\" target=\"_blank\">AWS</a>. The Terraform Registry requires the root of every repo to contain Terraform code, so we've put one of the examples there. This example is great for learning and experimenting, but for production use, please use the underlying modules in the <a href=\"/repos/v0.7.10/terraform-aws-consul/modules\" class=\"preview__body--description--blue\">modules folder</a> directly.</li>\n</ul>\n<p>To deploy Consul servers for production using this repo:</p>\n<ol>\n<li>\n<p>Create a Consul AMI using a Packer template that references the <a href=\"/repos/v0.7.10/terraform-aws-consul/modules/install-consul\" class=\"preview__body--description--blue\">install-consul module</a>.\nHere is an <a href=\"/repos/v0.7.10/terraform-aws-consul/examples/consul-ami#quick-start\" class=\"preview__body--description--blue\">example Packer template</a>.</p>\n<p>If you are just experimenting with this Module, you may find it more convenient to use one of our official public AMIs:</p>\n<ul>\n<li><a href=\"/repos/v0.7.10/terraform-aws-consul/_docs/ubuntu16-ami-list.md\" class=\"preview__body--description--blue\">Latest Ubuntu 16 AMIs</a>.</li>\n<li><a href=\"/repos/v0.7.10/terraform-aws-consul/_docs/amazon-linux-ami-list.md\" class=\"preview__body--description--blue\">Latest Amazon Linux 2 AMIs</a>.</li>\n</ul>\n<p><strong>WARNING! Do NOT use these AMIs in your production setup. In production, you should build your own AMIs in your own\nAWS account.</strong></p>\n</li>\n<li>\n<p>Deploy that AMI across an Auto Scaling Group using the Terraform <a href=\"/repos/v0.7.10/terraform-aws-consul/modules/consul-cluster\" class=\"preview__body--description--blue\">consul-cluster module</a>\nand execute the <a href=\"/repos/v0.7.10/terraform-aws-consul/modules/run-consul\" class=\"preview__body--description--blue\">run-consul script</a> with the <code>--server</code> flag during boot on each\nInstance in the Auto Scaling Group to form the Consul cluster. Here is <a href=\"/repos/v0.7.10/terraform-aws-consul/examples/root-example#quick-start\" class=\"preview__body--description--blue\">an example Terraform\nconfiguration</a> to provision a Consul cluster.</p>\n</li>\n</ol>\n<p>To deploy Consul clients for production using this repo:</p>\n<ol>\n<li>Use the <a href=\"/repos/v0.7.10/terraform-aws-consul/modules/install-consul\" class=\"preview__body--description--blue\">install-consul module</a> to install Consul alongside your application code.</li>\n<li>Before booting your app, execute the <a href=\"/repos/v0.7.10/terraform-aws-consul/modules/run-consul\" class=\"preview__body--description--blue\">run-consul script</a> with <code>--client</code> flag.</li>\n<li>Your app can now use the local Consul agent for service discovery and key/value storage.</li>\n<li>Optionally, you can use the <a href=\"/repos/v0.7.10/terraform-aws-consul/modules/install-dnsmasq\" class=\"preview__body--description--blue\">install-dnsmasq module</a> for Ubuntu 16.04 and Amazon Linux 2 or <a href=\"/repos/v0.7.10/terraform-aws-consul/modules/setup-systemd-resolved\" class=\"preview__body--description--blue\">setup-systemd-resolved</a> for Ubuntu 18.04 to configure Consul as the DNS for a\nspecific domain (e.g. <code>.consul</code>) so that URLs such as <code>foo.service.consul</code> resolve automatically to the IP\naddress(es) for a service <code>foo</code> registered in Consul (all other domain names will be continue to resolve using the\ndefault resolver on the OS).</li>\n</ol>\n<h2 class=\"preview__body--subtitle\" id=\"whats-a-module\">What's a Module?</h2>\n<p>A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such\nas a database or server cluster. Each Module is created using <a href=\"https://www.terraform.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Terraform</a>, and\nincludes automated tests, examples, and documentation. It is maintained both by the open source community and\ncompanies that provide commercial support.</p>\n<p>Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse\nexisting code that has been proven in production. And instead of maintaining all that infrastructure code yourself,\nyou can leverage the work of the Module community to pick up infrastructure improvements through\na version number bump.</p>\n<h2 class=\"preview__body--subtitle\" id=\"who-maintains-this-module\">Who maintains this Module?</h2>\n<p>This Module is maintained by <a href=\"http://www.gruntwork.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Gruntwork</a>. If you're looking for help or commercial\nsupport, send an email to <a href=\"mailto:modules@gruntwork.io?Subject=Consul%20Module\" class=\"preview__body--description--blue\" target=\"_blank\">modules@gruntwork.io</a>.\nGruntwork can help with:</p>\n<ul>\n<li>Setup, customization, and support for this Module.</li>\n<li>Modules for other types of infrastructure, such as VPCs, Docker clusters, databases, and continuous integration.</li>\n<li>Modules that meet compliance requirements, such as HIPAA.</li>\n<li>Consulting & Training on AWS, Terraform, and DevOps.</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"code-included-in-this-module\">Code included in this Module:</h2>\n<ul>\n<li>\n<p><a href=\"/repos/v0.7.10/terraform-aws-consul/modules/install-consul\" class=\"preview__body--description--blue\">install-consul</a>: This module installs Consul using a\n<a href=\"https://www.packer.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Packer</a> template to create a Consul\n<a href=\"http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html\" class=\"preview__body--description--blue\" target=\"_blank\">Amazon Machine Image (AMI)</a>.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.7.10/terraform-aws-consul/modules/consul-cluster\" class=\"preview__body--description--blue\">consul-cluster</a>: The module includes Terraform code to deploy a Consul AMI across an <a href=\"https://aws.amazon.com/autoscaling/\" class=\"preview__body--description--blue\" target=\"_blank\">Auto\nScaling Group</a>.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.7.10/terraform-aws-consul/modules/run-consul\" class=\"preview__body--description--blue\">run-consul</a>: This module includes the scripts to configure and run Consul. It is used\nby the above Packer module at build-time to set configurations, and by the Terraform module at runtime\nwith <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts\" class=\"preview__body--description--blue\" target=\"_blank\">User Data</a>\nto create the cluster.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.7.10/terraform-aws-consul/modules/install-dnsmasq\" class=\"preview__body--description--blue\">install-dnsmasq module</a>: Install <a href=\"http://www.thekelleys.org.uk/dnsmasq/doc.html\" class=\"preview__body--description--blue\" target=\"_blank\">Dnsmasq</a>\nfor Ubuntu 16.04 and Amazon Linux 2 and configure it to forward requests for a specific domain to Consul. This allows you to use Consul as a DNS server\nfor URLs such as <code>foo.service.consul</code>.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.7.10/terraform-aws-consul/modules/setup-systemd-resolved\" class=\"preview__body--description--blue\">setup-systemd-resolved module</a>: Setup <a href=\"https://www.freedesktop.org/software/systemd/man/resolved.conf.html\" class=\"preview__body--description--blue\" target=\"_blank\">systemd-resolved</a>\nfor ubuntu 18.04 and configure it to forward requests for a specific domain to Consul. This allows you to use Consul as a DNS server\nfor URLs such as <code>foo.service.consul</code>.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.7.10/terraform-aws-consul/modules/consul-iam-policies\" class=\"preview__body--description--blue\">consul-iam-policies</a>: Defines the IAM policies necessary for a Consul cluster.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.7.10/terraform-aws-consul/modules/consul-security-group-rules\" class=\"preview__body--description--blue\">consul-security-group-rules</a>: Defines the security group rules used by a\nConsul cluster to control the traffic that is allowed to go in and out of the cluster.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.7.10/terraform-aws-consul/modules/consul-client-security-group-rules\" class=\"preview__body--description--blue\">consul-client-security-group-rules</a>: Defines the security group rules\nused by a Consul agent to control the traffic that is allowed to go in and out.</p>\n</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-i-contribute-to-this-module\">How do I contribute to this Module?</h2>\n<p>Contributions are very welcome! Check out the <a href=\"/repos/v0.7.10/terraform-aws-consul/CONTRIBUTING.md\" class=\"preview__body--description--blue\">Contribution Guidelines</a> for instructions.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-is-this-module-versioned\">How is this Module versioned?</h2>\n<p>This Module follows the principles of <a href=\"http://semver.org/\" class=\"preview__body--description--blue\" target=\"_blank\">Semantic Versioning</a>. You can find each new release,\nalong with the changelog, in the <a href=\"/repos/releases\" class=\"preview__body--description--blue\">Releases Page</a>.</p>\n<p>During initial development, the major version will be 0 (e.g., <code>0.x.y</code>), which indicates the code does not yet have a\nstable API. Once we hit <code>1.0.0</code>, we will make every effort to maintain a backwards compatible API and use the MAJOR,\nMINOR, and PATCH versions on each release to indicate any incompatibilities.</p>\n<h2 class=\"preview__body--subtitle\" id=\"license\">License</h2>\n<p>This code is released under the Apache 2.0 License. Please see <a href=\"/repos/v0.7.10/terraform-aws-consul/LICENSE\" class=\"preview__body--description--blue\">LICENSE</a> and <a href=\"/repos/v0.7.10/terraform-aws-consul/NOTICE\" class=\"preview__body--description--blue\">NOTICE</a> for more\ndetails.</p>\n<p>Copyright © 2017 Gruntwork, Inc.</p>\n","repoName":"terraform-aws-consul","repoRef":"v0.7.10","serviceDescriptor":{"serviceName":"HashiCorp Consul","serviceRepoName":"terraform-aws-consul","serviceRepoOrg":"hashicorp","cloudProviders":["aws"],"description":"Deploy a Consul cluster. Supports automatic bootstrapping, DNS, Consul UI, and auto healing.","imageUrl":"consul.png","licenseType":"open-source","technologies":["Terraform","Bash"],"compliance":[],"tags":[""]},"serviceCategoryName":"Service Mesh","fileName":"README.md","filePath":"","title":"Repo Browser: HashiCorp Consul","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}