Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support .terraform.lock.hcl files when upgrading providers #68

Closed
jrobison-sb opened this issue Mar 7, 2022 · 2 comments · Fixed by #90
Closed

Support .terraform.lock.hcl files when upgrading providers #68

jrobison-sb opened this issue Mar 7, 2022 · 2 comments · Fixed by #90

Comments

@jrobison-sb
Copy link

Terraform 0.14 and higher uses .terraform.lock.hcl files with a hash of each provider/platform to be used. It would be nice if tfupdate was able to auto-update these lock files when upgrading providers. For example:

tfupdate --version 1.2.3 --recursive --platform darwin_amd64 --platform linux_amd64 aws ./

And this would do what tfupdate already does, and it would also do the equivalent of terraform providers lock -platform=darwin_amd64 -platform=linux_amd64 and recursively update all the lockfiles.

@minamijoyo
Copy link
Owner

Hi @jrobison-sb, Thank you for your proposal.

Yes, the lock file management is very annoying due to the current technical limitation of the Terraform core and registry.

The current workaround is #32
The root cause of this problem is described in the upstream issue hashicorp/terraform#27264

In short, without support for providing h1 hashes in the Terraform registry, we need to reimplement a lot of terraform internals and it would be hard to support multiple terraform versions in a stable way.

Having that said, I agree with that it would be great if the tfupdate updates not only version constraints, but also lock files, so I keep this issue open as a feature request.

Thanks!

@minamijoyo
Copy link
Owner

The tfupdate v0.7.0 introduced a new tfupdate lock command. For details, see #90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants