Issues with Terraform provider updates in local child modules #22402
wiebeck
started this conversation in
Suggest an Idea
Replies: 2 comments 3 replies
-
Currently we only look for a silbling lockfike renovate/lib/modules/manager/terraform/lockfile/util.ts Lines 25 to 27 in 5624b5e we can probably also look inside upper dirs for lockfile. I'll test it now |
Beta Was this translation helpful? Give feedback.
1 reply
-
should be supported with |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Type of discussion.
I just want to chat
Tell us more.
We're having issues updating our
required_providers
in Terraform child modules. Terraform recommends to list providers with lower bound version in modules where they are being used. TFLint complains if we list providers in modules (e.g. the root module) where they are not being used. We want to make both TFLint happy and allow Renovate to properly update provider versions in both the.tf
file (if it's an exact version) and the.terraform.lock.hcl
file.If we specify version constraints with lower bound (e.g.
>= 3.2.0
) for a provider in a child module then Renovate seems to completely ignore the provider. This can be observerd here: https://github.com/wiebeck/tflint-renovate-3If we specify exact version numbers for a provider in a child module Renovate properly updates the version in the
.tf
file but does not update the lock file in the root module causing errors when runningterraform init
. This can be observed here: https://github.com/wiebeck/tflint-renovate-2Renovate only works as expected if we list all providers in the root module, even if they are only being used in child modules. The child module needs to specify the provider again but may omit the version constraint. Unfortunately this violates the TFLint rule that checks for unused providers since not all providers are actually being used in the root module. This can be observed here: https://github.com/wiebeck/tflint-renovate-1
We're in a dilemma here. We want to write nice code (tflint) and want to incorporate all provider updates (Renovate) but it seems we cannot accomplish that without using workarounds. :-/
I believe it can be considered a "bug" if Renovate updates a provider version in a child module without adapting the lock file. Once this is solved we're happy again. :-)
Do you experience the same? Do you have any recommendations?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions