Skip to content

Commit cfe4477

Browse files
authored
docs(terraform_validate): Add note about cache and parallelism (#642)
1 parent c29bdb1 commit cfe4477

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,8 @@ To replicate functionality in `terraform_docs` hook:
674674

675675
* `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.
676676

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

680680
```yaml
681681
- id: terraform_validate
@@ -868,6 +868,9 @@ To replicate functionality in `terraform_docs` hook:
868868

869869
### terraform_validate
870870

871+
> [!IMPORTANT]
872+
> 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).
873+
871874
1. `terraform_validate` supports custom arguments so you can pass supported `-no-color` or `-json` flags:
872875

873876
```yaml

0 commit comments

Comments
 (0)