Skip to content

terraform validate: Force rerun t init when plugin cache is enabled and parrallelism conflit happens  #640

Open
@maxbrunet

Description

@maxbrunet

What problem are you facing?

#620 introduces parallelism, this can lead to data races when the plugin cache is enabled, with terraform init writing in parallel to the cache, and creating corrupted providers (especially visible with the lock file where random provider hashes get appended).

This can be worked around by setting the --hook-config=--parallelism-limit=1 arg on terraform_validate hook.

How could pre-commit-terraform help solve your problem?

It would be nice if the hooks using terraform init (mostly terraform_validate, but terragrunt_providers_lock has it deprecated too) could disable parallelism automatically when the TF_PLUGIN_CACHE_DIR environment variable is set.

Not sure if handling the case where plugin_cache_dir is set in the config file would be possible.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions