Workflows
Workflows can be used to replace the default workflow steps Terrateam executes during an Operation.
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.
Configuration
Top-level key: workflows
See Configuration Reference documentation for details.
Key | Type | Description |
---|---|---|
tag_query | Tag Query | Workflow configuration for a Tag Query. |
Default configuration:
workflows:
- tag_query: ""
terragrunt: false
terraform_version: latest
lock_policy: "strict"
plan:
- type: init
- type: plan
apply:
- type: init
- type: apply
Tag Query
A list of all tags that must be present in a tag set in order to match the workflow. See Tags documentation for Tag Query details.
Each tag_query
consists of a map as a value.
The value map has the following attributes:
Key | Type | Description |
---|---|---|
plan | Plan | Plan steps. |
apply | Apply | Apply steps. |
terragrunt | Boolean | Override the terraform command with terragrunt . Default is false . |
terraform_version | Boolean | Override the Terraform version specified in default_tf_version. |
lock_policy | string | When the directory should have a lock acquired. Values are strict (acquire a lock if either it is merged or applied), apply (only acquire a lock when it is applied), merge (only acquire a lock when it is merged), and none (never acquire a lock). Default is strict . |
Plan
Plan
Plan steps.
Key | Type | Description |
---|---|---|
type | String | Terrateam step type: init , plan , env , run . |
Extra Arguments
Extra command line arguments passed to the terraform
command.
Environment Variables
Key | Type | Description |
---|---|---|
name | String | Name of environment variable. |
cmd | List | Command to use to set environment variable. |
trim_trailing_newlines | Boolean | Trim trailing newlines. Default is true . |
Run
Key | Type | Description |
---|---|---|
cmd | List | Command to run from the directory that Terrateam is operating against. |
run_on | String | Run the command on step success , failure , or always . Default is success . |
capture_output | Boolean | When capture_output is set to true , command output is included in the GitHub pull request comment on a failure. Sensitive data is not masked. Be aware, this data is sent back to the Terrateam backend for processing. Default is false . |
env | Object | Environment variables to set for this execution. Object keys are environment variable names and the value is a string. |
Apply
Apply
Apply steps.
Key | Type | Description |
---|---|---|
type | String | Terrateam step type: init , apply , env , run . |
Extra Arguments
Extra command line arguments passed to the terraform
command.
Environment Variables
Key | Type | Description |
---|---|---|
name | String | Name of environment variable. |
cmd | List | Command to use to set environment variable. |
trim_trailing_newlines | Boolean | Trim trailing newlines. Default is true . |
Run
Key | Type | Description |
---|---|---|
cmd | List | Command to run from the directory that Terrateam is operating against. |
run_on | String | Run the command on step success , failure , or always . Default is success . |
capture_output | Boolean | When capture_output is set to true , command output is included in the GitHub pull request comment on a failure. Sensitive data is not masked. Be aware, this data is sent back to the Terrateam backend for processing. Default is false . |
env | Object | Environment variables to set for this execution. Object keys are environment variable names and the value is a string. |