You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our terraform commands run on atlantis on a linux_amd64 container. Many of my users are on darwin_arm64 machines and we are using a provider version that does not have darwin_arm64 binaries in its release (infobloxopen/infoblox v1.1.1). This causes terraform init to fail because it cannot download a provider for the user's platform. I told them to instead use terraform providers lock -platform=linux_amd64 to generate the lock file. This is fine for generating an initial lock file but it will not perform an upgrade. It tells you to use init for that.
So, init cannot be told a specific platform and providers lock cannot be told to upgrade. This is the proverbial rock and hard place.
Attempted Solutions
Right now I told them to delete the lock file before they run terraform providers lock -platform=linux_amd64 when they need to upgrade a provider version.
Proposal
Add an -upgrade flag to terraform providers lock or add a -platform flag to terraform init.
References
No response
The text was updated successfully, but these errors were encountered:
grimm26
changed the title
terraform providers lock and terraform init between a rock and a hard place
terraform providers lock cannot upgrade and terraform init cannot specify a platform
Mar 28, 2023
Hello @grimm26 ,
If my memory serves me right,I remember looking at a similar issue few months ago, which still remains open.
I believe there was a proposal to explore a future update like: terraform providers lock -upgrade -platform=darwin_amd64 -platform=linux_amd64
This suggestion has been explained in detail here, if it helps.
Unfortunately, I think there are only a few workarounds which can be useful for now, which could be accommodated as a Makefile target to refresh providers for different platforms.
The linked workaround uses init and therefore only works if all providers have an available build for the local platform where the command is being run. In OP's case, that's not the case, so init will fail. The only workaround I'm aware of is to delete the lockfile and then run providers lock.
Terraform Version
Use Cases
Our terraform commands run on atlantis on a linux_amd64 container. Many of my users are on darwin_arm64 machines and we are using a provider version that does not have darwin_arm64 binaries in its release (infobloxopen/infoblox v1.1.1). This causes
terraform init
to fail because it cannot download a provider for the user's platform. I told them to instead useterraform providers lock -platform=linux_amd64
to generate the lock file. This is fine for generating an initial lock file but it will not perform an upgrade. It tells you to use init for that.So,
init
cannot be told a specific platform andproviders lock
cannot be told to upgrade. This is the proverbial rock and hard place.Attempted Solutions
Right now I told them to delete the lock file before they run
terraform providers lock -platform=linux_amd64
when they need to upgrade a provider version.Proposal
Add an
-upgrade
flag toterraform providers lock
or add a-platform
flag toterraform init
.References
No response
The text was updated successfully, but these errors were encountered: