You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Providing more efficient use of module blocks with less repetition of common vars in root main.tf files
Attempted Solutions
Terragrunt
Proposal
Currently if we want to pass many common variables into a module block from a root main.tf, we have to explicitly enter each common var into each module block, repeating many common vars across many modules unnecessarily.
and then being able to pass this into each module simply with
inputs = local.common_vars.inputs
It would be really helpful if terraform could pass in a special map as a var like this to module blocks as a standard like... terraform_common_vars = var.myvarmap
The difference with this ability to standard vars would be:
The terraform_common_vars map will treat each key in the map as a var for the module block
If keys are in the map that do not exist in the module, this would not cause an error. The behaviour would be similar to using environment variables in this way and be silent.
Some of the benefits of Terragrunt are able to be performed in pure terraform if done carefully, but efficient passing through of common variables is something I haven't yet seen and would be really useful in reducing repetition.
The text was updated successfully, but these errors were encountered:
Current Terraform Version
Use-cases
Providing more efficient use of module blocks with less repetition of common vars in root main.tf files
Attempted Solutions
Terragrunt
Proposal
Currently if we want to pass many common variables into a module block from a root main.tf, we have to explicitly enter each common var into each module block, repeating many common vars across many modules unnecessarily.
Terragrunt has a nice solution to this with
and then being able to pass this into each module simply with
It would be really helpful if terraform could pass in a special map as a var like this to module blocks as a standard like...
terraform_common_vars = var.myvarmap
The difference with this ability to standard vars would be:
Some of the benefits of Terragrunt are able to be performed in pure terraform if done carefully, but efficient passing through of common variables is something I haven't yet seen and would be really useful in reducing repetition.
The text was updated successfully, but these errors were encountered: