{"id":15641807,"url":"https://github.com/paulrbr/terraform-makefile","last_synced_at":"2025-04-30T09:15:16.931Z","repository":{"id":68756023,"uuid":"102335184","full_name":"paulRbr/terraform-makefile","owner":"paulRbr","description":" Makefile to use as a simple interface for Terraform","archived":false,"fork":false,"pushed_at":"2021-10-04T11:44:46.000Z","size":165,"stargazers_count":71,"open_issues_count":0,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-30T09:15:06.863Z","etag":null,"topics":["makefile","password-store","terraform"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulRbr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2017-09-04T08:04:28.000Z","updated_at":"2025-01-08T05:34:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1ee3efe-07a9-4c42-aa25-942b5f9d8708","html_url":"https://github.com/paulRbr/terraform-makefile","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulRbr%2Fterraform-makefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulRbr%2Fterraform-makefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulRbr%2Fterraform-makefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulRbr%2Fterraform-makefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulRbr","download_url":"https://codeload.github.com/paulRbr/terraform-makefile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251674585,"owners_count":21625645,"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":["makefile","password-store","terraform"],"created_at":"2024-10-03T11:45:57.816Z","updated_at":"2025-04-30T09:15:16.893Z","avatar_url":"https://github.com/paulRbr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Makefile for Terraform users\n\n[![Build Status](https://travis-ci.org/paulRbr/terraform-makefile.svg?branch=master)](https://travis-ci.org/paulRbr/terraform-makefile) [![Docker Hub](https://img.shields.io/docker/automated/swcc/terraform-makefile.svg)](https://hub.docker.com/r/swcc/terraform-makefile/)\n\nThis repository provides a Makefile to give you a simple interface for [Terraform](https://www.terraform.io/).\n\n## Why?\n\n- Simplify your CLI terraform runs\n- Don't Repeat Yourself while typing terraform commands\n- Easier adoption for people that are not used to Terraform\n- Document common usage\n- Unique entrypoint script for credentials management (only for AWS, Azure, DigitalOcean, Google, Hetzner and Scaleway for now)\n  - either passing ENV variables. E.g. `\u003cPROVIDER\u003e_\u003cENV\u003e_SECRET` will be mapped to `DIGITALOCEAN_TOKEN` if `provider=do` is provided as variable\n  - either using [`pass`](https://www.passwordstore.org/) as local secret manager. E.g. password `terraform/\u003cprovider\u003e/\u003cenv\u003e/secret` will be mapped to `DIGITALOCEAN_TOKEN` if `provider=do` is provided as variable\n  - either using [`vault`](https://www.vaultproject.io/) as distributed secret manager (Only for AWS credentials for now). E.g. by using `VAULT_ADDR` and either `VAULT_ROLE_ID` + `VAULT_SECRET_ID` or directly a `VAULT_TOKEN` your credentials will automatically be fetched into your vault.\n\n## Installation\n\n### Package install\n\n(for now packages are only published in [Github releases](https://github.com/paulRbr/terraform-makefile/releases))\n\n    wget https://github.com/paulRbr/terraform-makefile/releases/download/\u003cversion\u003e/tf-make_\u003cversion\u003e_amd64.deb\n    dpkg -i tf-make_\u003cversion\u003e.deb\n\n### Manual install\n\nSimply download the `Makefile` and the `terraform.sh` files in safe place.\n\n    mkdir -p /opt/terraform\n    cd /opt/terraform\n    wget -N https://raw.githubusercontent.com/paulRbr/terraform-makefile/master/{Makefile,terraform.sh}\n\nThen you will need to add the `tf-make` binary (it's a simple bash script) in your $PATH. WARNING: you'll need to change the Makefile path in the `tf-make` file.\n\n## Convention\n\nThis makefile assumes your terraform configuration files are stored in a specific directory structure:\n\nI.e. `providers/\u003cprovider\u003e/\u003cenv\u003e/*.tf`\n\nE.g. example for all supported providers:\n```\nproviders/\n├── aws\n│   ├── prod\n│   │   └── config.tf\n│   └── test\n│       └── config.tf\n├── do\n│   └── prod\n│       └── config.tf\n├── google\n│   ├── prod\n│   │   └── config.tf\n│   └── test\n│       └── config.tf\n├── hetzner,scaleway\n│   └── test\n│       └── config.tf\n├── hetzner\n│   └── prod\n│       └── config.tf\n└── scaleway\n    └── prod\n        └── config.tf\n```\n\n\n_Note: the `provider` name can be a combination of multiple providers when you are in a multi-cloud environment. E.g. `providers/hetzner,scaleway/prod/config.tf`._\n\n## Commands\n\nList of commands made available\n\n~~~bash\n\u003e make\nTerraform-makefile v0.14.11\n\nconsole                        Console infra resources\ndestroy                        Destroy resources\ndry-run                        Dry run resources changes\nfmt                            Rewrites config to canonical format\nimport                         Import infra resources\ninstall                        Install terraform and dependencies\nlint                           Lint the HCL code\nraw                            Raw command sent to terraform\nrefresh                        Refresh infra resources\nrun                            Execute resources changes\nshow                           List infra resources\nstate                          Inspect or change the remote state of your resources\ntaint                          Taint infra resources\nuntaint                        Untaint infra resources\nvalidate                       Basic syntax check\nworkspace                      Workspace infra resources\n~~~\n\n## Variables\n\nDetails of the variables that can be passed to commands:\n\n\n| Name       | Default | Values                                                                                                                       | Description                             | Example                                                                                                                                                                                                                                                                                                                                        |\n| ---------  | ------- | ------                                                                                                                       | -----------                             | -------                                                                                                                                                                                                                                                                                                                                        |\n| `provider` | -       | `aws`\u003cbr/\u003e`azure`\u003cbr/\u003e`do`\u003cbr/\u003e`google`\u003cbr/\u003e`hetzner`\u003cbr/\u003e`scaleway`\u003cbr/\u003eor any combination of those separated by commas `,` | Name of the cloud provider(s) to target | With your terraform file in `provider/aws/production/production.tf` you will be able to `make dry-run provider=aws env=production`\u003cbr/\u003eWith a terraform file in `provider/hetzner,scaleway/production/config.tf` you will be able to `make dry-run provider=hetzner,scaleway env=production` and have credentials for both providers available |\n| `env`      | -       | `String`                                                                                                                     | Name of the environment you want to use | With a terraform file in `provider/google/production/production.tf` you will be able to `make dry-run provider=google env=production`                                                                                                                                                                                                          |\n| `args`     | -       | `String`                                                                                                                     | Add terraform understandable arguments  | `make dry-run args='-no-color'`                                                                                                                                                                                                                                                                                                                |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulrbr%2Fterraform-makefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulrbr%2Fterraform-makefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulrbr%2Fterraform-makefile/lists"}