Hooks can be used to run commands or set environment variables pre and post
Workflows. Pre and post hooks are only executed
a single time during a Terrateam Operation. Commands are executed from the
repository checkout directory $TERRATEAM_ROOT
.
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: hooks
See Configuration Reference documentation
for details.
Key | Type | Description |
---|
all | All | Pre and post hook configuration to run around all operations. |
plan | Plan | Pre and post hook configuration for Plan operations. |
apply | Apply | Pre and post hook configuration for Apply operations. |
Default configuration:
hooks:
all:
pre: []
post: []
plan:
pre: []
post: []
apply:
pre: []
post: []
All
All
Key | Type | Description |
---|
pre | Pre | Commands to run before any hooks. |
post | Post | Commands to run after any hooks. |
Pre
Commands to run before any hooks.
Key | Type | Description |
---|
type | String | Pre-hook type: env , run . |
Env
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 . |
Post
Commands to run after any hooks.
Key | Type | Description |
---|
type | String | Post-hook type: env , run . |
Env
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 . |
Plan
Plan
Key | Type | Description |
---|
pre | Pre | Commands to run before a plan workflow. |
post | Post | Commands to run after a plan workflow. |
Pre
Commands to run before a Plan workflow.
Key | Type | Description |
---|
type | String | Pre-hook type: env , run . |
Env
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 . |
Post
Commands to run after a Plan workflow.
Key | Type | Description |
---|
type | String | Post-hook type: env , run . |
Env
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 . |
Apply
Apply
Key | Type | Description |
---|
pre | Pre | Commands to run before an apply workflow. |
post | Post | Commands to run after an apply workflow. |
Pre
Commands to run before a Apply workflow.
Key | Type | Description |
---|
type | String | Pre-hook type: env , run . |
Env
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 . |
Post
Commands to run after a pply workflow.
Key | Type | Description |
---|
type | String | Post-hook type: env , run . |
Env
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 . |