pre-commit icon indicating copy to clipboard operation
pre-commit copied to clipboard

add option to customize flags to terraform init for terraform validate

Open scbunn opened this issue 4 years ago • 1 comments

Describe the solution you'd like The terraform lock file is causing issues with terraform validate being run in an automated job. Terraform init is updating the hashes in the lockfile and thus failing the job because it detects changes were made to files.

For now this can be fixed by not checking in the lock file but this is outside of what hashicorp is recommending.

scbunn avatar Mar 22 '22 21:03 scbunn

@scbunn This is a very late answer but I faced the same problems. What helped me fix it was running

terraform providers lock -platform=linux_amd64 -platform=windows_amd64

This adds all hashes for these two platforms to the lock file. It's also describe at the end of the section https://www.terraform.io/language/files/dependency-lock#new-provider-package-checksums

wolfm89 avatar Sep 01 '22 11:09 wolfm89