Terraform Format
Terrateam Configuration
Terrateam behavior can be configured via a config.yml
. This file is located in
a directory named .terrateam
at the root of your Terraform repository:
.terrateam/config.yml
.
See Configuration documentation for details.
The terraform fmt
command can be executed before a
Plan operation using a custom
Workflow.
terraform fmt
When a Plan operation runs, the exit status of terraform fmt
against
the changed files in the pull request can be used to determine the
success or failure of the entire operation. This grants users the
ability to enforce terraform fmt
passing before running a
terraform plan
.
Configuration
The Terrateam configuration file can be configured
to execute terraform fmt
with a custom workflow. Tags
and Tag Queries can be used
to target specific Dirspaces.
.terrateam/config.yml
workflows:
- tag_query: ""
plan:
- type: run
cmd: ['terraform', 'fmt', '-diff', '-check']
capture_output: true
- type: init
- type: plan
If a user were to initiate a pull request against the foo/bar/main.tf
file then the Terrateam Plan operation would first execute terraform fmt -diff -check
in the foo/bar/
directory. The entire Plan operation would fail if the terraform fmt
command returns a non-zero exit code.