-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Add CLI command to upgrade lock file without full initialization #27161
Comments
Hi @secustor, If I'm understanding correctly the use-case you're describing, I think the existing |
Thx for the fast response! This works for initially creating the lock file but not for updating it. As this is pretty similar to the use case which I have, there could be a flag added to
BTW |
I noticed that the For example: main.tf
foo/foo.tf
In my use-case, I have 200+ root modules and I'm automating a provider version upgrade process in CI, it's possible but inefficient that updating lock files requires initialization |
Hi @minamijoyo, Thanks for that additional note. Unfortunately I'm not sure how best to deal with that constraint because the content of your modules contributes to deciding which providers and which versions to select, so we do need to have all of the modules available in order to make a correct version selection in order to update the lock file. 🤔 |
It seems like part of what might help here is for the
Thanks! |
A workaround for the moment, to get the same effect as I described for this |
@apparentlymart Thank you for your reply. I have a related but different concern. So I've opened a new issue #27264 for sharing my context in detail. |
Current Terraform Version
Use-cases
Currently to update the Terraform lock file a complete init has to be performed, but there are cases when the Dev has not all the configuration options available e.g. blob storage access keys for the backend.
Therefore he can not run
terraform init -upgrade
.The same goes for centrally run tooling, where you want to also split up the secret management.
Attempted Solutions
Locally the user can remove the backend block temporarily.
Automation has not this option available.
Proposal
Add a flag which prevents the backend initialization
terraform init -upgrade -skip-backend
Would you accept a PR for this?
The text was updated successfully, but these errors were encountered: