Open kaovd opened 3 weeks ago
Hi @kaovd, thank you for bringing this to our attention. I noticed that in the reproduction steps, you've used the resource group id instead of its name.
data "azurerm_arc_machine" "machines" {
for_each = { for machine in var.arc_machines : machine.name => machine }
name = each.key
resource_group_name = azurerm_resource_group.datacenter[each.value.site].id
}
Could this be the cause of the issue?
Is there an existing issue for this?
Community Note
Terraform Version
1.9.2
AzureRM Provider Version
4.0.7
Affected Resource(s)/Data Source(s)
data.azurerm_arc_machine
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Azurerm should have recognized no properties in the resource where changing and continued as normal
Actual Behaviour
All resources dependent on data.azurerm_arc_machine reported the resource id is changing and would be known after apply
Steps to Reproduce
Configuration Sample:
When the resource group resource had tagging changes, as tags where changed outside of configuration, this caused the arc data machine resource to reflect the following:
I have sanitized names, but the naming and capitalization of resource group and item where completely unchanged.
Due to this, the terraform configuration seemed unsure if the resource id of these components would change
This effectively broke my entire setup
I was able to fix this and have it stop changing everything by just manually specifying the resource group as text in the data block
It is possible to make it so azurerm is concious of whether a resource change into a data block is actually meaningful to the properties its accessing or the properties would be affected? Is this a limitation?
Important Factoids
N/A
References
None