hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.54k stars 4.61k forks source link

casing issue with azurerm_private_endpoint private_dns_zone_ids #27378

Open fgarcia-cnb opened 3 weeks ago

fgarcia-cnb commented 3 weeks ago

Is there an existing issue for this?

Community Note

Terraform Version

1.8.5

AzureRM Provider Version

3.111.0

Affected Resource(s)/Data Source(s)

azurerm_private_endpoint

Terraform Configuration Files

dynamic "private_dns_zone_group" {
    for_each = local.is_ampls ? [1] : []
    content {
      name                 = "${var.host_names[floor(count.index / length(var.subresource_names))]}-${var.subresource_names[count.index % length(var.subresource_names)]}${var.cosmos_failover_pe_suffix}-pe-dnz-zone-group"
      private_dns_zone_ids = data.azurerm_private_dns_zone.ampls_zones[*].id
    }

Debug Output/Panic Output

n/a

Expected Behaviour

resource id casing differences should not trigger changes

Actual Behaviour

changes in resource group casing triggers changes

image

Steps to Reproduce

No response

Important Factoids

No response

References

No response

magodo commented 2 weeks ago

I think it is related to https://github.com/hashicorp/terraform-provider-azurerm/pull/24024, but I can't reproduce it locally. Could you please try to run the following snippet and provides the state and the log file:

provider "azurerm" {
  features {}
}

resource "azurerm_private_dns_zone" "test" {
  name                = "acctestzone123.internal"
  resource_group_name = data.azurerm_resource_group.<your rg>.name
}

data "azurerm_private_dns_zone" "test" {
  name                = azurerm_private_dns_zone.test.name
  resource_group_name = azurerm_private_dns_zone.test.resource_group_name
}