feat: Pass custom arguments to terraform init in terraform_validate hook (#293)

This commit is contained in:
Maxime Brunet 2021-12-11 05:33:22 -08:00 committed by GitHub
commit 45575c3a43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View file

@ -526,7 +526,15 @@ Example:
- --envs=AWS_SECRET_ACCESS_KEY="asecretkey"
```
3. It may happen that Terraform working directory (`.terraform`) already exists but not in the best condition (eg, not initialized modules, wrong version of Terraform, etc.). To solve this problem, you can find and delete all `.terraform` directories in your repository:
3. `terraform_validate` also supports passing custom arguments to its `terraform init`:
```yaml
- id: terraform_validate
args:
- --init-args=-lockfile=readonly
```
4. It may happen that Terraform working directory (`.terraform`) already exists but not in the best condition (eg, not initialized modules, wrong version of Terraform, etc.). To solve this problem, you can find and delete all `.terraform` directories in your repository:
```bash
echo "