az network vnet subnet show --resource-group example-rg --vnet-name example-network --name CASEPRESERVED --query id
"/subscriptions/XXXXX/resourceGroups/example-rg/providers/Microsoft.Network/virtualNetworks/example-network/subnets/CASEPRESERVED"
az network vnet subnet show --resource-group example-rg --vnet-name example-network --name CaSePrEsErVeD --query id
"/subscriptions/XXXXX/resourceGroups/example-rg/providers/Microsoft.Network/virtualNetworks/example-network/subnets/CASEPRESERVED"
az network private-endpoint show --name example-endpoint --resource-group example-rg --query subnet.id
"/subscriptions/XXXXX/resourceGroups/example-rg/providers/Microsoft.Network/virtualNetworks/example-network/subnets/CASEPRESERVED"
Expected Behaviour
because the azurerm_subnet data resource returns the casing from the search & not the result, and the subnet_id passed into the azurerm_private_endpoint is normalised either by Terraform or Azure, we're stuck in permanent drift.
No changes. Your infrastructure matches the configuration.
Actual Behaviour
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# azurerm_private_endpoint.example must be replaced
-/+ resource "azurerm_private_endpoint" "example" {
~ custom_dns_configs = [
- {
- fqdn = "terratest1234.blob.core.usgovcloudapi.net"
- ip_addresses = [
- "10.0.1.4",
]
},
] -> (known after apply)
~ id = "/subscriptions/XXXXX/resourceGroups/example-rg/providers/Microsoft.Network/privateEndpoints/example-endpoint" -> (known after apply)
name = "example-endpoint"
~ network_interface = [
- {
- id = "/subscriptions/XXXXX/resourceGroups/example-rg/providers/Microsoft.Network/networkInterfaces/example-endpoint.nic.cde0a0d8-6342-4e36-9c0c-5258508ae4c7"
- name = "example-endpoint.nic.cde0a0d8-6342-4e36-9c0c-5258508ae4c7"
},
] -> (known after apply)
~ private_dns_zone_configs = [] -> (known after apply)
~ subnet_id = "/subscriptions/XXXXX/resourceGroups/example-rg/providers/Microsoft.Network/virtualNetworks/example-network/subnets/CASEPRESERVED" -> "/subscriptions/XXXXX/resourceGroups/example-rg/providers/Microsoft.Network/virtualNetworks/example-network/subnets/CaSePrEsErVeD" # forces replacement
- tags = {} -> null
# (2 unchanged attributes hidden)
~ private_service_connection {
name = "example-privateserviceconnection"
~ private_ip_address = "10.0.1.4" -> (known after apply)
# (3 unchanged attributes hidden)
}
}
Plan: 1 to add, 0 to change, 1 to destroy.
Is there an existing issue for this?
Community Note
Terraform Version
1.3.4
AzureRM Provider Version
3.29.1
Affected Resource(s)/Data Source(s)
azurerm_private_endpoint
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
because the
azurerm_subnet
data resource returns the casing from the search & not the result, and thesubnet_id
passed into theazurerm_private_endpoint
is normalised either by Terraform or Azure, we're stuck in permanent drift.Actual Behaviour
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
No response
References
related to https://github.com/hashicorp/terraform-provider-azurerm/issues/19148