Skip to content

Commit

Permalink
docs(terraform_validate): Add note about cache and parallelism (#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunet authored Mar 8, 2024
1 parent c29bdb1 commit cfe4477
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,8 @@ To replicate functionality in `terraform_docs` hook:

* `only-check-is-current-lockfile-cross-platform` with [terraform_validate hook](#terraform_validate) - make up-to-date lockfile by adding/removing providers and only then check that lockfile has all required SHAs.

> **Important**
> Next `terraform_validate` flag requires additional dependency to be installed: `jq`. Also, it could run another slow and time consuming command - `terraform init`
> **Important**
> Next `terraform_validate` flag requires additional dependency to be installed: `jq`. Also, it could run another slow and time consuming command - `terraform init`

```yaml
- id: terraform_validate
Expand Down Expand Up @@ -868,6 +868,9 @@ To replicate functionality in `terraform_docs` hook:

### terraform_validate

> [!IMPORTANT]
> If you use [`TF_PLUGIN_CACHE_DIR`](https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache), we recommend enabling `--hook-config=--retry-once-with-cleanup=true` or disabling parallelism (`--hook-config=--parallelism-limit=1`) to avoid [race conditions when `terraform init` writes to it](https://github.com/hashicorp/terraform/issues/31964).

1. `terraform_validate` supports custom arguments so you can pass supported `-no-color` or `-json` flags:

```yaml
Expand Down

0 comments on commit cfe4477

Please sign in to comment.