Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Hook Timeout #119

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions website/docs/cloud-docs/agents/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ Please note the following behavior when using hooks:
create a `pre-plan` and `pre-apply` hook, but you cannot create two
`pre-plan` hooks.
- Each hook must have the execute permission set.
- Each hook has a 60 second timeout. If a hook times out the Terraform run will
fail immediately.
- Environment variables do not persist across hooks. For example, if a
- Each hook has a default timeout of 60 seconds and a max timeout of 10 minutes. You can
configure the timeout for each hook in seconds using an environment variable with the
hook's name `TFC_AGENT_HOOK_[HOOK NAME]_TIMEOUT`. For example, you can set the timeout
for the pre-plan hook to 2 minutes by setting `TFC_AGENT_HOOK_PRE_PLAN_TIMEOUT=120`. If
a hook times out, the Terraform run fails immediately.
- Terraform environment variables do not persist across hooks. For example, if a
`pre-plan` hook exports environment variables, they will not be available
during the `post-plan` hook. Similarly, if `terraform plan` exports
environment variables, they will not be available during the `post-plan` hook.

## Setting environment variables
## Setting Terraform Environment Variables

Hooks may be used to set environment variables for subsequent `terraform`
commands to use. To set an environment variable, write lines in `KEY=value`
Expand Down