aztfmod / terraform-azurerm-caf

Terraform supermodule for the Terraform platform engineering for Azure
https://aztfmod.github.io/documentation/
MIT License
563 stars 709 forks source link

Expose custom_variables from lower levels to n+2 level #1136

Open sharmilamusunuru opened 2 years ago

sharmilamusunuru commented 2 years ago

As, we know we can refer to custom variables set in lower level (n) can be referred in n+1 level by mapping tfstate as lower in landingzone.tfvars but indeed customer wanted to infer them in n+2 landingzone.tfvars when n+1 tfstate is not mapped and wanted to directly call "n" level as lower, by exporting that variable.

sharmilamusunuru commented 2 years ago

Hi Team, As, we know that output variables from lower level "n" will be accessible to "n+1" level by referencing lower "n" tfstate in "landingzone.tfvars" and can be mapped in the code like below:

identity = { type = "UserAssigned" remote = { launchpad = { managed_identity_keys = [ "level0"] } } } But all, we wanted to reference that launchpad variables from n+2 level. Instead of using resource ID our customer wanted to use variables from n level to all higher levels whether n+2, n+3 etc.