The develop environment for Terraform projects.
Out of the box📦 for any Terraform project:
- Supports any Terraform version🙆 by tfenv
- Auto format on save by HashiCorp Terraform Extension
- Implements efficient commands🚀 for:
- Format and test code quickly
terraform fmt -recursive
terraform validate
- TFLint (if
.tflint.hcl
exists in Terraform project)
- Plan all environment (supports running as parallel)
- Render differences report of all plans
- Format and test code quickly
- Customizable by jinja in YAML configuration file🔧
- The directory to run terraform command
- The command to select environment and prepare to plan.
- The command to plan
git clone https://github.com/yukihiko-shinoda/docker-compose-terraform.git
cd docker-compose-terraform
git clone <repository of your Terraform project>
code .
Run the Remote-Containers: Reopen in Container
command from the Command Palette (F1
) or quick actions Status bar item.
Copy config.yml.dist
to config.yml
, then edit it.
Details is explained by comments in its file.
Copy report.md.jinja.dist
to report.md.jinja
, then edit it.
The differences of all plan is rendered at point of corresponding environment name which is defined into config.yml
.
EX:
projects:
terraform-project-a:
# ------------------------------
environments:
dev: {}
prod: {}
## dev
```console
{{ dev }}
```
## prod
```console
{{ prod }}
```
fmt-test <project directory name>
EX:
fmt-test terraform-project-a
Note: If you are using Terraform Enterprise, it requires to login to Terraform Enterprise before run following commands.
pytest tests --prj <project name defined in YAML>
EX:
pytest tests --prj terraform-project-a
pytest tests --prj <project name defined in YAML> -n <number of processes>
EX:
pytest tests --prj terraform-project-a -n 3
python report.py
Then, report will be render to ./report.md
.