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

Terraform/OpenTofu lock files are not updated with child module constraints #29944

Open
rarkins opened this issue Jun 30, 2024 Discussed in #29821 · 1 comment
Open

Terraform/OpenTofu lock files are not updated with child module constraints #29944

rarkins opened this issue Jun 30, 2024 Discussed in #29821 · 1 comment
Labels
manager:terraform Terraform package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Jun 30, 2024

Discussed in #29821

Originally posted by bdalpe June 24, 2024

What would you like help with?

I think I found a bug

How are you running Renovate?

Mend Renovate hosted app on github.com

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

GitHub

Please tell us more about your question or problem

This is a re-open of #17402.

Renovate does not correctly update version constraints in .terraform.lock.hcl files in root modules that contain child modules when constraints are not explicitly provided in the root module.

Renovate only changes the version constraints and hashes if the root module contains required_providers or providers blocks. This is not ideal behavior because TF does not require these to be specified at the root level. When running terraform init, these dependencies are written into the lock file from recursively extracting the required_providers from all child and sub-child modules.

It would be awesome if Renovate could update this automatically.

Reproduction: https://github.com/renovate-reproductions/29944

@rarkins rarkins added type:bug Bug fix of existing functionality priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:terraform Terraform package manager labels Jun 30, 2024
@secustor
Copy link
Collaborator

secustor commented Jun 30, 2024

This is only possible with local modules ATM, as we decided against running an initialization of Terraform/OpenTofu before running the manager. The reason has been that Renovate would need access to all modules and backend states, which include secrets like access tokens and such.

Therefore IMO not a bug, but rather a feature request to support module constraints at all.

@rarkins rarkins added type:feature Feature (new functionality) status:requirements Full requirements are not yet known, so implementation should not be started and removed type:bug Bug fix of existing functionality labels Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:terraform Terraform package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

2 participants