Closed ghost closed 1 month ago
Hi @mnavaltaequitydine ,
I was able to reproduce the issue. For some reason var.storage_account_tags == {}
returns false
even so var.storage_account_tags
is empty 🤔
As a hotfix, you can use length(...)
function instead, like:
tags = length(var.storage_account_tags) == 0 ? data.azurerm_resource_group.resource_group.tags : var.storage_account_tags
@AlexPykavy - sorry for the confusion, but we can actually treat it as is like:
Within this module.
....
tags = data.azurerm_resource_group.resource_group.tags
}
Will yield either empty if the resource_group is being created at the same time within the apply, or actually not empty if the resource_group is created prior to this the current apply.
Could you please share the full definition of your azurerm_storage_account
from the module?
@mnavaltaequitydine If the resource group is created along with the module that referencing the tags
, then the plan will indicate the tags
to be known after apply, e.g.:
+ tags = (known after apply)
Thank you for taking the time to raise this! I am going to close this with @magodo‘s response as an answer. If you have future questions, I suggest using the Community Resources, such as the Azure Provider forum.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Is there an existing issue for this?
Community Note
Terraform Version
1.8.5
AzureRM Provider Version
3.107.0
Affected Resource(s)/Data Source(s)
azurerm_resource_group
Terraform Configuration Files
data.azurerm_resource_group.resource_group.tags
shows up as empty map even though it's populated in the console.