{"id":26225103,"url":"https://github.com/kulpree/hashistack-ami-build","last_synced_at":"2025-07-21T07:03:25.807Z","repository":{"id":121810024,"uuid":"379008087","full_name":"kulpree/Hashistack-ami-build","owner":"kulpree","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-25T18:16:15.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T18:12:04.042Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kulpree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-21T17:15:38.000Z","updated_at":"2021-06-25T18:16:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c5c8d3d-2cc2-43a0-9a96-1baba73ec16f","html_url":"https://github.com/kulpree/Hashistack-ami-build","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kulpree/Hashistack-ami-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpree%2FHashistack-ami-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpree%2FHashistack-ami-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpree%2FHashistack-ami-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpree%2FHashistack-ami-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kulpree","download_url":"https://codeload.github.com/kulpree/Hashistack-ami-build/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpree%2FHashistack-ami-build/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266255244,"owners_count":23900098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-12T18:30:35.019Z","updated_at":"2025-07-21T07:03:25.788Z","avatar_url":"https://github.com/kulpree.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hashistack-ami-build\n\n# Nomad and Consul AMI\n\nThis folder shows an example of how to use the [install-nomad module](https://github.com/hashicorp/terraform-aws-nomad/tree/master/modules/install-nomad) from this Module and\nthe [install-consul module](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/install-consul)\nfrom the Consul AWS Module with [Packer](https://www.packer.io/) to create [Amazon Machine Images\n(AMIs)](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html) that have Nomad and Consul installed on top of:\n\n1. Ubuntu 16.04\n1. Ubuntu 18.04\n1. Amazon Linux 2\n\nThese AMIs will have [Consul](https://www.consul.io/) and [Nomad](https://www.nomadproject.io/) installed and\nconfigured to automatically join a cluster during boot-up.\n\nTo see how to deploy this AMI, check out the [nomad-consul-colocated-cluster\nexample](https://github.com/hashicorp/terraform-aws-nomad/tree/master/examples/root-example). For more info on Nomad installation and configuration, check out\nthe [install-nomad](https://github.com/hashicorp/terraform-aws-nomad/tree/master/modules/install-nomad) documentation.\n\n\n\n## Quick start\n\nTo build the Nomad and Consul AMI:\n\n1. `git clone` this repo to your computer.\n1. Install [Packer](https://www.packer.io/).\n1. Configure your AWS credentials using one of the [options supported by the AWS\n   SDK](http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html). Usually, the easiest option is to\n   set the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables.\n1. Update the `variables` section of the `nomad-consul.json` Packer template to configure the AWS region and Nomad version\n   you wish to use.\n1. Run `packer build nomad-consul.json`.\n\nWhen the build finishes, it will output the IDs of the new AMIs. To see how to deploy one of these AMIs, check out the\n[nomad-consul-colocated-cluster example](https://github.com/hashicorp/terraform-aws-nomad/tree/master/examples/root-example).\n\n\n\n\n## Creating your own Packer template for production usage\n\nWhen creating your own Packer template for production usage, you can copy the example in this folder more or less\nexactly, except for one change: we recommend replacing the `file` provisioner with a call to `git clone` in the `shell`\nprovisioner. Instead of:\n\n```json\n{\n  \"provisioners\": [{\n    \"type\": \"file\",\n    \"source\": \"{{template_dir}}/../../../terraform-aws-nomad\",\n    \"destination\": \"/tmp\"\n  },{\n    \"type\": \"shell\",\n    \"inline\": [\n      \"/tmp/terraform-aws-nomad/modules/install-nomad/install-nomad --version {{user `nomad_version`}}\"\n    ],\n    \"pause_before\": \"30s\"\n  }]\n}\n```\n\nYour code should look more like this:\n\n```json\n{\n  \"provisioners\": [{\n    \"type\": \"shell\",\n    \"inline\": [\n      \"git clone --branch \u003cmodule_VERSION\u003e https://github.com/hashicorp/terraform-aws-nomad.git /tmp/terraform-aws-nomad\",\n      \"/tmp/terraform-aws-nomad/modules/install-nomad/install-nomad --version {{user `nomad_version`}}\"\n    ],\n    \"pause_before\": \"30s\"\n  }]\n}\n```\n\nYou should replace `\u003cmodule_VERSION\u003e` in the code above with the version of this module that you want to use (see\nthe [Releases Page](../../releases) for all available versions). That's because for production usage, you should always\nuse a fixed, known version of this Module, downloaded from the official Git repo. On the other hand, when you're\njust experimenting with the Module, it's OK to use a local checkout of the Module, uploaded from your own\ncomputer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkulpree%2Fhashistack-ami-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkulpree%2Fhashistack-ami-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkulpree%2Fhashistack-ami-build/lists"}