gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
8.09k stars 981 forks source link

Support Version Constraint Syntax for modules loaded from a Terraform registry #1930

Open chilicat opened 2 years ago

chilicat commented 2 years ago

Support Version Constraint Syntax for modules loaded from a Terraform registry:

At the moment it is not possible to use the version constrains to load a module from the terraform registry The current configuration looks like:

terraform {
  source = "tfr://myregistry.io/mymodule/azurerm?version=0.0.1"

However I would like to be able to use any build version, in Terraform you would configure it like:

module "mymodule" {
  source = "myregistry.io/mymodule/azurerm"
  version = "~> 0.0.1"
}

The configuration above would automatically use 0.0.2/3/4 if available.

Version:

Terraform v1.0.10
Terragrunt version v0.35.12

Other resources:

Chris-Softrams commented 2 years ago

Any progress? From https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/ it says:

source (attribute): Specifies where to find Terraform configuration files. This parameter supports the exact same syntax as the [module source](https://www.terraform.io/docs/modules/sources.html) parameter for Terraform module
yhakbar commented 1 month ago

This is a sensible ask, and AFAIK, the only reason it hasn't been implemented is that we haven't prioritized it.

Most folks are able to do just fine with explicit version pins.

That being said, I would happily review a PR to add this capability. If we find bandwidth to address this on the maintainer team, we will also look to address this ourselves.