Config help for terraform modules in a monorepo #28222
Replies: 1 comment · 6 replies
-
why are you using a regex manager? the terraform manager should work out of the box |
Beta Was this translation helpful? Give feedback.
All reactions
-
yes, your match package patterns is totally wrong. best is to remove that rule for now. we can better help you if you create a reproduction |
Beta Was this translation helpful? Give feedback.
All reactions
-
I have tried to create a better reproduction. I have one monorepo for terraform modules: https://github.com/acaylor/renovate-tf-test-modules and one monorepo for terraform roots: https://github.com/acaylor/renovate-tf-test-roots I am starting with a config file that is mostly just the recommended settings in each of those repos. {
"extends": [
"config:recommended",
":separateMultipleMajorReleases",
":ignoreUnstable",
":dependencyDashboard"
],
"configMigration": true
} In this state, I have added tags to the terraform modules monorepo. Renovate opened a PR to update the AWS tf provider which is good and all I expect in the current state of that repo. The problem is in the other monorepo where the module is instantiated along with a module from the public terraform registry and the AWS terraform provider. Renovate seems to detect the module from the other repo as a dependency but makes no PR/ recommendation to update to the latest tag. It does open a PR for the public terraform module and the AWS provider. We would like Renovate to suggest an update from Here are the debug logs for the
|
Beta Was this translation helpful? Give feedback.
All reactions
-
set https://docs.renovatebot.com/configuration-options/#versioncompatibility |
Beta Was this translation helpful? Give feedback.
All reactions
-
If that is done, does that mean there would need to be an additional configuration for every single homegrown Terraform module? That seems cumbersome. In addition, it seems strange that renovate can see that the dependency exists, but doesn't realize that the new version does. |
Beta Was this translation helpful? Give feedback.
All reactions
-
you can set it with |
Beta Was this translation helpful? Give feedback.
-
What would you like help with?
I would like help with my configuration
How are you running Renovate?
Self-hosted
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
Self-hosted renovate GitHub, dockerhub image 37-full
Please tell us more about your question or problem
We would like to use renovate to update terraform modules that we have in a monorepo. All modules are in a directory
modules
. We use git tags to control versioning of the modules.We are attempting to use a custom manager with regex to parse the line in a .tf file that has the module
source
which for us is a git tag.This is the configuration we tried
We tried to implement regex to capture tags for terraform modules that would look like this:
module-foo-v1.1.0
from a git ref in our .tf files looking likesource = https://github.com/org/repo//modules/module-foo?ref=module-foo-v1.1.1
Renovate recognized the module instantiation in a terraform root
main.tf
but the PR it opened suggested a version tag for the repo that does not include thecompatibility
capture group i.e. the tagv0.0.2
instead of the desiredmodule-foo-v0.0.2
.I have been testing with a public repo that follows our pattern: https://github.com/acaylor/renovate-tf-test
Am I missing something in the
versioningTemplate
to leverage the compatibility capture group?Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions