-
Notifications
You must be signed in to change notification settings - Fork 10.3k
terraform providers lock should use the plugin cache #33837
Copy link
Copy link
Closed
Labels
Description
Terraform Version
Terraform v1.5.6Use Cases
Provider maintenance: Regular updates.
We have many workspaces and we use multiple architectures:
- macOS amd64 and arm64 for local development.
- Windows amd64 for local development.
- Linux amd64 for the CI.
Updating the .terraform.lock.hcl of a workspace via terraform providers lock -platform=darwin_arm64 -platform=darwin_amd64 -platform=linux_amd64 -platform=windows_amd64 takes very long.
For all of the workspaces, the hashes (even of the not modified providers) are retrieved over and over from the registry.
So this "penalty" even multiplies.
Recently, the repeated downloads even fail: E.g.
Error: Could not retrieve providers for locking
Terraform failed to fetch the requested providers for darwin_arm64 in order to calculate their checksums: some providers could not be installed:
- registry.terraform.io/gitlabhq/gitlab: github.com: Get "https://github.com/gitlabhq/terraform-provider-gitlab/releases/download/v16.3.0/terraform-provider-gitlab_16.3.0_darwin_arm64.zip": dial tcp 140.82.121.3:443: i/o timeout.
Downloading the file with the browser is no problem.
Attempted Solutions
I configured the plugin cache. But it is not used by terraform providers lock.
Proposal
Let terraform providers lock use the plugin cache (read & write). That includes caching plugins of all architectures.
References
Reactions are currently unavailable