Repo Browser: HashiCorp Nomad You need to enable JavaScript to run this app.
Gruntwork Website
HashiCorp Nomad Deploy a Nomad cluster. Supports automatic bootstrapping, discovery of Consul servers, automatic recovery of failed servers.
Nomad AWS Module
This repo contains a set of modules for deploying a Nomad cluster on
AWS using Terraform . Nomad is a distributed, highly-available
data-center aware scheduler. A Nomad cluster typically includes a small number of server nodes, which are responsible
for being part of the consensus protocol , and a larger
number of client nodes, which are used for running jobs.
Features
Deploy server nodes for managing jobs and client nodes running jobs
Supports colocated clusters and separate clusters
Least privilege security group rules for servers
Auto scaling and Auto healing
Learn
This repo is maintained by Gruntwork , and follows the same patterns as the Gruntwork
Infrastructure as Code Library , a collection of reusable,
battle-tested, production ready infrastructure code. You can read How to use the Gruntwork Infrastructure as Code
Library for an overview
of how to use modules maintained by Gruntwork!
Core concepts
Nomad Use Cases : overview of various use cases that Nomad is
optimized for.
Nomad Guides : official guide on how to configure and setup Nomad
clusters as well as how to use Nomad to schedule services on to the workers.
Nomad Security : overview of how to secure your Nomad clusters.
Repo organization
modules : the main implementation code for this repo, broken down into multiple standalone, orthogonal submodules.
examples : This folder contains working examples of how to use the submodules.
test : Automated tests for the modules and examples.
root : The root folder is an example of how to use the nomad-cluster module module to deploy a Nomad 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.
Deploy
Non-production deployment (quick start for learning)
If you just want to try this repo out for experimenting and learning, check out the following resources:
examples folder : The examples
folder contains sample code optimized for learning, experimenting, and testing (but not production usage).
Production deployment
If you want to deploy this repo in production, check out the following resources:
Manage
Day-to-day operations
Major changes
Support
If you need help with this repo or anything else related to infrastructure or DevOps, Gruntwork offers Commercial Support via Slack, email, and phone/video. If you're already a Gruntwork customer, hop on Slack and ask away! If not, subscribe now . If you're not sure, feel free to email us at support@gruntwork.io .
Contributions
Contributions to this repo are very welcome and appreciated! If you find a bug or want to add a new feature or even contribute an entirely new module, we are very happy to accept pull requests, provide feedback, and run your changes through our automated test suite.
Please see CONTRIBUTING.md for instructions.
License
Please see LICENSE for details on how the code in this repo is licensed.
Copyright © 2019 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":"20968ed882b09a03245770f84b523b73cd64df78"}]},{"name":".gitignore","path":".gitignore","sha":"6c4ebe4426586b7febbaba178294ef59b8272c05"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"5949dbc0fa6d4dd6610575e3c878c353d92da44a"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","sha":"4c6520097a38c2b63e7a91e20a4c06f8005e6fe4"},{"name":"LICENSE","path":"LICENSE","sha":"7a4a3ea2424c09fbe48d455aed1eaa94d9124835"},{"name":"NOTICE","path":"NOTICE","sha":"4653ef2dace926e046f74ab82c82647558c7e94f"},{"name":"README.md","path":"README.md","sha":"48583f19e9257d330a8d9e6f041b101932490d56","toggled":true},{"name":"_ci","children":[{"name":"publish-amis-in-new-account.md","path":"_ci/publish-amis-in-new-account.md","sha":"3182a0a90775f7bb9622c037196ac2a1f15e455d"},{"name":"publish-amis.sh","path":"_ci/publish-amis.sh","sha":"6902cb1e3d7624ecc91096bcd48c5c91e248c653"}]},{"name":"_docs","children":[{"name":"amazon-linux-ami-list.md","path":"_docs/amazon-linux-ami-list.md","sha":"6607a70497e27d57222552281825053783ad7bb2"},{"name":"architecture-nomad-consul-colocated.png","path":"_docs/architecture-nomad-consul-colocated.png","sha":"438a8b71d1afdc7f91065b910e9de2d6d7d9517c"},{"name":"architecture-nomad-consul-separate.png","path":"_docs/architecture-nomad-consul-separate.png","sha":"df28d183fb8090fabc457ee56f3fb43ded6a5b13"},{"name":"architecture.png","path":"_docs/architecture.png","sha":"e539a77e88af6849d0893be35a8c5b5270edb195"},{"name":"nomad-icon.png","path":"_docs/nomad-icon.png","sha":"193298e1f719d6fb51513d0d9631dafaa17cfaf3"},{"name":"ubuntu16-ami-list.md","path":"_docs/ubuntu16-ami-list.md","sha":"4c1af1d6d863e0e6120520b65d823ee2ae2e2079"}]},{"name":"core-concepts.md","path":"core-concepts.md","sha":"314e6e4769a0316adbce0ff39196f1821544c9ce"},{"name":"examples","children":[{"name":"nomad-consul-ami","children":[{"name":"README.md","path":"examples/nomad-consul-ami/README.md","sha":"3e1ffc13902ee7ff46ef750a1e03d316ff4afedf"},{"name":"nomad-consul-docker.json","path":"examples/nomad-consul-ami/nomad-consul-docker.json","sha":"89df67eabeeb9e07f039dbe085e1932f592992d3"},{"name":"nomad-consul.json","path":"examples/nomad-consul-ami/nomad-consul.json","sha":"58a462d3443bf5f067f24f438919aab6c696b715"},{"name":"setup_amazon-linux.sh","path":"examples/nomad-consul-ami/setup_amazon-linux.sh","sha":"afa4e86365348ab91616f08d3fae0a28c64e158f"},{"name":"setup_nomad_consul.sh","path":"examples/nomad-consul-ami/setup_nomad_consul.sh","sha":"c4e68a5affa34caab8e4197028dfc1970c33da6e"},{"name":"setup_ubuntu.sh","path":"examples/nomad-consul-ami/setup_ubuntu.sh","sha":"81268f86b1ccf5a567ec913dd1dbbe3b3868ad93"}]},{"name":"nomad-consul-separate-cluster","children":[{"name":"README.md","path":"examples/nomad-consul-separate-cluster/README.md","sha":"4f8ee73c20f575cb86ed28fb05840d093e6f2f15"},{"name":"main.tf","path":"examples/nomad-consul-separate-cluster/main.tf","sha":"c29c23f9c54e171826309ed3f00a13552b3c6147"},{"name":"outputs.tf","path":"examples/nomad-consul-separate-cluster/outputs.tf","sha":"fab958b55d52594d98df8391c4282e5c4c1f008a"},{"name":"user-data-consul-server.sh","path":"examples/nomad-consul-separate-cluster/user-data-consul-server.sh","sha":"659e77d66aa4140f776cfbeb9e71f1a874b00682"},{"name":"user-data-nomad-client.sh","path":"examples/nomad-consul-separate-cluster/user-data-nomad-client.sh","sha":"c52069299ee4fe73fbd9cd5d4f48be8ef6a35b3d"},{"name":"user-data-nomad-server.sh","path":"examples/nomad-consul-separate-cluster/user-data-nomad-server.sh","sha":"1b99ff7d6b56999da42c04d5405e81c738214af1"},{"name":"variables.tf","path":"examples/nomad-consul-separate-cluster/variables.tf","sha":"78d0882b72b80b9b8eea67d4950e15b826647e1d"}]},{"name":"nomad-examples-helper","children":[{"name":"README.md","path":"examples/nomad-examples-helper/README.md","sha":"4b42111e7abf289798df0c62847edc722bcd6256"},{"name":"example.nomad","path":"examples/nomad-examples-helper/example.nomad","sha":"63958e3d491757da48a72255ec3b8882302ba33e"},{"name":"nomad-examples-helper.sh","path":"examples/nomad-examples-helper/nomad-examples-helper.sh","sha":"7f5f10afb2331d88268d53fe7e7d8deb0585a8db"}]},{"name":"root-example","children":[{"name":"README.md","path":"examples/root-example/README.md","sha":"9c2e4ffd4e0ffcf6e4d4a6d31583205251a6c67d"},{"name":"user-data-client.sh","path":"examples/root-example/user-data-client.sh","sha":"d6bac10fb2bb654d3255052d863ab19c9cdd41bc"},{"name":"user-data-server.sh","path":"examples/root-example/user-data-server.sh","sha":"109bdeb1f8df56b35d6bf1a6e5346cae4aca61f5"}]}]},{"name":"main.tf","path":"main.tf","sha":"5b21e3855375c578f5946961181efd25ad8426bc"},{"name":"modules","children":[{"name":"install-nomad","children":[{"name":"README.md","path":"modules/install-nomad/README.md","sha":"f793a3975dc6d8a06873a7f6a8ef1892eba01d84"},{"name":"install-nomad","path":"modules/install-nomad/install-nomad","sha":"5a74c98520010121d95d3432f08dffced7c2f761"},{"name":"supervisor-initd-script.sh","path":"modules/install-nomad/supervisor-initd-script.sh","sha":"171b91613e98ab2bd10282025caff1707918c95a"},{"name":"supervisord.conf","path":"modules/install-nomad/supervisord.conf","sha":"d96beb0ca9a16279ed1bdf74cbb6516275d85085"}]},{"name":"nomad-cluster","children":[{"name":"README.md","path":"modules/nomad-cluster/README.md","sha":"e47de8d5174ca6020601898c386a8de2e06f021d"},{"name":"main.tf","path":"modules/nomad-cluster/main.tf","sha":"e46194c1170b25016dd4ed1dfb068af1583d47a6"},{"name":"outputs.tf","path":"modules/nomad-cluster/outputs.tf","sha":"341778300126873e11e2cf9d964bccd927c2644e"},{"name":"variables.tf","path":"modules/nomad-cluster/variables.tf","sha":"b0293a8dc30f988ca63af42e06e7a7cefaabde91"}]},{"name":"nomad-security-group-rules","children":[{"name":"README.md","path":"modules/nomad-security-group-rules/README.md","sha":"c35eab862bdd870569408a9ad55e8abb6894e4fe"},{"name":"main.tf","path":"modules/nomad-security-group-rules/main.tf","sha":"51438a98f6defe8045c21437e4b1d95b3f42061c"},{"name":"variables.tf","path":"modules/nomad-security-group-rules/variables.tf","sha":"a3d9d4b0b2abcce058d41b61b099fa115a7babd3"}]},{"name":"run-nomad","children":[{"name":"README.md","path":"modules/run-nomad/README.md","sha":"c66430e400076f3afbbfa9ff55abcc2aec7564f2"},{"name":"run-nomad","path":"modules/run-nomad/run-nomad","sha":"0216b1713f86310fa21fba9d4feacbffc45c9067"}]}]},{"name":"outputs.tf","path":"outputs.tf","sha":"f3efe59a6784255e79e0a7a77cf4b4ce2461278f"},{"name":"test","children":[{"name":"Gopkg.lock","path":"test/Gopkg.lock","sha":"fc3214f34d7c2f6d5d1c1ab6f9ecf1a85bfb06f8"},{"name":"Gopkg.toml","path":"test/Gopkg.toml","sha":"a84c6ed7e5bfce6f72e9e08666f1665af01a3f84"},{"name":"README.md","path":"test/README.md","sha":"874818e6da7a9c0c9338edde0c27fa3f8a3b3d05"},{"name":"aws_helpers.go","path":"test/aws_helpers.go","sha":"c7b6601bf58485e5deddbb1e17f433b0c12c9dae"},{"name":"nomad_consul_cluster_colocated_test.go","path":"test/nomad_consul_cluster_colocated_test.go","sha":"365b422c08e52295c1ff0bb211df4d5c973766a9"},{"name":"nomad_consul_cluster_separate_test.go","path":"test/nomad_consul_cluster_separate_test.go","sha":"0750f6f9bc45a650355e0d3c2557abae45ac7e73"},{"name":"nomad_helpers.go","path":"test/nomad_helpers.go","sha":"1750e3d729d429c9062fde804f4a66a0d514d22d"},{"name":"terratest_helpers.go","path":"test/terratest_helpers.go","sha":"f6e176e37bc9ce4c5322834a0325bc9ff1b836b4"}]},{"name":"variables.tf","path":"variables.tf","sha":"0941f7c8577a1db5d7fdafbd274deb87813c0ca9"}]},"detailsContent":"<p></p>\n<h1 class=\"preview__body--title\" id=\"nomad-aws-module\">Nomad AWS Module</h1><div class=\"preview__body--border\"></div><p><a href=\"https://gruntwork.io/?ref=repo_aws_nomad\" 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>\n<img src=\"https://img.shields.io/badge/tf-%3E%3D0.12.0-blue.svg\" alt=\"Terraform Version\" class=\"preview__body--diagram\"></p>\n<p>This repo contains a set of modules for deploying a <a href=\"https://www.nomadproject.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Nomad</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>. Nomad is a distributed, highly-available\ndata-center aware scheduler. A Nomad cluster typically includes a small number of server nodes, which are responsible\nfor being part of the <a href=\"https://www.nomadproject.io/docs/internals/consensus.html\" class=\"preview__body--description--blue\" target=\"_blank\">consensus protocol</a>, and a larger\nnumber of client nodes, which are used for running jobs.</p>\n<p><img src=\"/repos/images/v0.6.2/terraform-aws-nomad/_docs/architecture.png\" alt=\"Nomad architecture\" class=\"preview__body--diagram\"></p>\n<h2 class=\"preview__body--subtitle\" id=\"features\">Features</h2>\n<ul>\n<li>Deploy server nodes for managing jobs and client nodes running jobs</li>\n<li>Supports colocated clusters and separate clusters</li>\n<li>Least privilege security group rules for servers</li>\n<li>Auto scaling and Auto healing</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"learn\">Learn</h2>\n<p>This repo is maintained by <a href=\"https://www.gruntwork.io\" class=\"preview__body--description--blue\" target=\"_blank\">Gruntwork</a>, and follows the same patterns as <a href=\"https://gruntwork.io/infrastructure-as-code-library/\" class=\"preview__body--description--blue\" target=\"_blank\">the Gruntwork\nInfrastructure as Code Library</a>, a collection of reusable,\nbattle-tested, production ready infrastructure code. You can read <a href=\"https://gruntwork.io/guides/foundations/how-to-use-gruntwork-infrastructure-as-code-library/\" class=\"preview__body--description--blue\" target=\"_blank\">How to use the Gruntwork Infrastructure as Code\nLibrary</a> for an overview\nof how to use modules maintained by Gruntwork!</p>\n<h3 class=\"preview__body--subtitle\" id=\"core-concepts\">Core concepts</h3>\n<ul>\n<li><a href=\"https://www.nomadproject.io/intro/use-cases.html\" class=\"preview__body--description--blue\" target=\"_blank\">Nomad Use Cases</a>: overview of various use cases that Nomad is\noptimized for.</li>\n<li><a href=\"https://www.nomadproject.io/guides/index.html\" class=\"preview__body--description--blue\" target=\"_blank\">Nomad Guides</a>: official guide on how to configure and setup Nomad\nclusters as well as how to use Nomad to schedule services on to the workers.</li>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/modules/nomad-cluster#security\" class=\"preview__body--description--blue\">Nomad Security</a>: overview of how to secure your Nomad clusters.</li>\n</ul>\n<h3 class=\"preview__body--subtitle\" id=\"repo-organization\">Repo organization</h3>\n<ul>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/modules\" class=\"preview__body--description--blue\">modules</a>: the main implementation code for this repo, broken down into multiple standalone, orthogonal submodules.</li>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/examples\" class=\"preview__body--description--blue\">examples</a>: This folder contains working examples of how to use the submodules.</li>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/test\" class=\"preview__body--description--blue\">test</a>: Automated tests for the modules and examples.</li>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad\" class=\"preview__body--description--blue\">root</a>: The root folder is <em>an example</em> of how to use the <a href=\"/repos/v0.6.2/terraform-aws-nomad/modules/nomad-cluster\" class=\"preview__body--description--blue\">nomad-cluster module</a> module to deploy a <a href=\"https://www.nomadproject.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Nomad</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.6.2/terraform-aws-nomad/modules\" class=\"preview__body--description--blue\">modules folder</a> directly.</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"deploy\">Deploy</h2>\n<h3 class=\"preview__body--subtitle\" id=\"non-production-deployment-quick-start-for-learning\">Non-production deployment (quick start for learning)</h3>\n<p>If you just want to try this repo out for experimenting and learning, check out the following resources:</p>\n<ul>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/examples\" class=\"preview__body--description--blue\">examples folder</a>: The <code>examples</code> folder contains sample code optimized for learning, experimenting, and testing (but not production usage).</li>\n</ul>\n<h3 class=\"preview__body--subtitle\" id=\"production-deployment\">Production deployment</h3>\n<p>If you want to deploy this repo in production, check out the following resources:</p>\n<ul>\n<li><a href=\"https://www.nomadproject.io/guides/install/production/index.html\" class=\"preview__body--description--blue\" target=\"_blank\">Nomad Production Setup Guide</a>:\ndetailed guide covering how to setup a production deployment of Nomad.</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"manage\">Manage</h2>\n<h3 class=\"preview__body--subtitle\" id=\"day-to-day-operations\">Day-to-day operations</h3>\n<ul>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/core-concepts.md#deploy-nomad-and-consul-in-the-same-cluster\" class=\"preview__body--description--blue\">How to deploy Nomad and Consul in the same\ncluster</a></li>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/core-concepts.md#deploy-nomad-and-consul-in-separate-clusters\" class=\"preview__body--description--blue\">How to deploy Nomad and Consul in separate\nclusters</a></li>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/modules/nomad-cluster/README.md#how-do-you-connect-to-the-nomad-cluster\" class=\"preview__body--description--blue\">How to connect to the Nomad cluster</a></li>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/modules/nomad-cluster/README.md#what-happens-if-a-node-crashes\" class=\"preview__body--description--blue\">What happens if a node crashes</a></li>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/modules/nomad-cluster/README.md#how-do-you-connect-load-balancers-to-the-auto-scaling-group-asg\" class=\"preview__body--description--blue\">How to connect load balancers to the ASG</a></li>\n</ul>\n<h3 class=\"preview__body--subtitle\" id=\"major-changes\">Major changes</h3>\n<ul>\n<li><a href=\"/repos/v0.6.2/terraform-aws-nomad/modules/nomad-cluster/README.md#how-do-you-roll-out-updates\" class=\"preview__body--description--blue\">How to upgrade a Nomad cluster</a></li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"support\">Support</h2>\n<p>If you need help with this repo or anything else related to infrastructure or DevOps, Gruntwork offers <a href=\"https://gruntwork.io/support/\" class=\"preview__body--description--blue\" target=\"_blank\">Commercial Support</a> via Slack, email, and phone/video. If you're already a Gruntwork customer, hop on Slack and ask away! If not, <a href=\"https://www.gruntwork.io/pricing/\" class=\"preview__body--description--blue\" target=\"_blank\">subscribe now</a>. If you're not sure, feel free to email us at <a href=\"mailto:support@gruntwork.io\" class=\"preview__body--description--blue\" target=\"_blank\">support@gruntwork.io</a>.</p>\n<h2 class=\"preview__body--subtitle\" id=\"contributions\">Contributions</h2>\n<p>Contributions to this repo are very welcome and appreciated! If you find a bug or want to add a new feature or even contribute an entirely new module, we are very happy to accept pull requests, provide feedback, and run your changes through our automated test suite.</p>\n<p>Please see <a href=\"/repos/v0.6.2/terraform-aws-nomad/CONTRIBUTING.md\" class=\"preview__body--description--blue\">CONTRIBUTING.md</a> for instructions.</p>\n<h2 class=\"preview__body--subtitle\" id=\"license\">License</h2>\n<p>Please see <a href=\"/repos/v0.6.2/terraform-aws-nomad/LICENSE\" class=\"preview__body--description--blue\">LICENSE</a> for details on how the code in this repo is licensed.</p>\n<p>Copyright © 2019 Gruntwork, Inc.</p>\n","repoName":"terraform-aws-nomad","repoRef":"v0.5.1","serviceDescriptor":{"serviceName":"HashiCorp Nomad","serviceRepoName":"terraform-aws-nomad","serviceRepoOrg":"hashicorp","cloudProviders":["aws"],"description":"Deploy a Nomad cluster. Supports automatic bootstrapping, discovery of Consul servers, automatic recovery of failed servers.","imageUrl":"nomad.png","licenseType":"open-source","technologies":["Terraform","Bash"],"compliance":[],"tags":[""]},"serviceCategoryName":"Docker orchestration","fileName":"README.md","filePath":"","title":"Repo Browser: HashiCorp Nomad","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}