Incorrect bindings generated for the Azure/naming/azurerm
module.
#3477
Labels
bug
Something isn't working
Azure/naming/azurerm
module.
#3477
Expected Behavior
The bindings generated for the https://github.com/Azure/terraform-azurerm-naming module do not correctly reference the output maps defined in their module..
For this module, the outputs function should return a map instead of a string. Or some other function that provides access to the output (that contains 8 keys). See https://github.com/Azure/terraform-azurerm-naming/blob/8a1c8616d4cd05423e53c3260a016919ce0df33d/main.tf#L1869-L1878
Actual Behavior
The creation of the cdktf bindings for the "Azure/naming/azurerm" module (https://github.com/Azure/terraform-azurerm-naming) do not properly handle their
map
output values.The root of the issue is that the language specific functions generated for this module yields a token that references a key->value map type, and not the actual output (string) value.
For example, calling
ResourceGroupOutput()
yields${module.resourceNaming.resource_group}
, where theresource_group
output value is actually a map. When running tf plan, we're greeted with the errormodule.resourceNaming.resource_group is object with 8 attributes
The module reference in question can be found at main.tf and output.tf
Steps to Reproduce
I have created an example repo that provides guidance on how to reproduce this behaviour. See https://github.com/jesseward/cdktf-aznaming-output-failure-example for details.
Versions
language: go
providers
Providers
Gist
https://github.com/jesseward/cdktf-aznaming-output-failure-example
Possible Solutions
No response
Workarounds
Modify the
cdktf.json
that references the module output, to specify the key in question. For exampleAnything Else?
I am not sure if this is a bug or expected behaviour due to an unsupported model of mapping output values within a module.
References
Looks like others have encountered similar issues as well and raised the following in the
Azure/terraform-azurerm-naming
repo.Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: