Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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 Manager: Support for definition of versions via locals and variables #16439

Closed
Boeller666 opened this issue Jul 6, 2022 · 8 comments

Comments

@Boeller666
Copy link

What would you like Renovate to be able to do?

We have extracted the versions for resources like helm_release into variables or locals to facilitate module reuse. However, some modules contain a default version inside a variable, but these can be overridden by other Terraform scripts that use them.

Currently, it appears that the Terraform manager does not recognize versions passed via locals or variables to resources like helm_release.

If you have any ideas on how this should be implemented, please tell us here.

I'd no deeper look inside the implementation of a manager... so no idea.

Is this a feature you are interested in implementing yourself?

No

@Boeller666 Boeller666 added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality) labels Jul 6, 2022
@secustor secustor added the auto:reproduction A minimal reproduction is necessary to proceed label Jul 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2022

Hi there,

Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible.

Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction.

We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team

@viceice
Copy link
Member

viceice commented Jul 6, 2022

you can use regex manager to update those variables as workaround. I'm using those a lot for my terraform infrastructure to replace docker registry to my proxy 😉

@PeterBennink
Copy link

@viceice Could you elaborate on how you're doing this? Given that it doesn't look like this ticket has made any progress:)

@viceice
Copy link
Member

viceice commented Oct 13, 2022

I'm using regex manager to update locals

@PeterBennink
Copy link

To be honest, this doesn't really work for us. We have a lot of different kinds of entities, this would require a lot of regex work.

@rarkins
Copy link
Collaborator

rarkins commented Oct 19, 2022

@PeterBennink you can help move this forward by providing a minimal reproduction

@norman-zon
Copy link

I am trying to do the same, but have an additional abstraction layer by using terragrunt.
Here is a minimal reproduction. The renovate.json has no regexManagers config yes, as I have no idea how to get started.

@norman-zon
Copy link

I solved it like this:

inputs = {
  # renovate: depName=kube-prometheus-stack registryUrl=https://prometheus-community.github.io/helm-charts
  prometheus_kube_stack_chart_version = "43.1.1"

  # renovate: datasource=docker depName=fastly-exporter registryUrl=https://ghcr.io/fastly
  prometheus_fastly_exporter_version = "v7.4.0"

and the corresponding regexManager config:

      {
        "description": "Update versions in common_vars.hcl",
        "fileMatch": ["/common_vars.hcl$"],
        "matchStrings": [
          "#\\s?renovate:(?: datasource=(?<datasource>.+?))? depName=(?<depName>.+?)(?: packageName=(?<packageName>.+?))?(?: registryUrl=(?<registryUrl>.+?))?(?: extractVersion=(?<extractVersion>.+?))?(?: versioning=(?<versioning>.+?))?\\s.+?_version\\s?=\\s?\"?(?<currentValue>.+?)\"?\\s"
        ],
        "datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}helm{{/if}}",
        "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}",
        "extractVersionTemplate": "{{#if extractVersion}}{{{extractVersion}}}{{else}}^v?(?<version>.+)${{/if}}"
      }

@rarkins rarkins removed type:feature Feature (new functionality) auto:reproduction A minimal reproduction is necessary to proceed status:requirements Full requirements are not yet known, so implementation should not be started priority-5-triage labels Oct 1, 2023
@renovatebot renovatebot locked and limited conversation to collaborators Oct 1, 2023
@rarkins rarkins converted this issue into discussion #24763 Oct 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@viceice @PeterBennink @rarkins @Boeller666 @secustor @norman-zon and others