Open achupryn opened 2 years ago
The same behavior in case update to v2.99
Hi @achupryn , thanks for submitting this, seems this issue is caused by PR https://github.com/hashicorp/terraform-provider-azurerm/pull/14241, which changes the resourcegroup
case in the ID of azurerm_kubernetes_cluster
resource (released in v2.88.0). I am working on a PR to fix this.
Hello @teowa,
I have a similaire issue with azurerm_api_management
azurerm version 2.99
azurerm_api_management.this will be updated in-place
~ resource "azurerm_api_management" "this" {
~ virtual_network_configuration {
~ subnet_id = "/subscriptions/***/resourcegroups/rg-myrg/providers/microsoft.network/virtualnetworks/vnet-myvnet/subnets/snet-mysnet" -> "/subscriptions/***/resourceGroups/rg-myrg/providers/Microsoft.Network/virtualNetworks/vnet-myvnet/subnets/snet-mysnet"
}
(8 unchanged blocks hidden)
}
resourcegroups != resourceGroups , microsoft.network != Microsoft.Network and virtualnetworks != virtualNetworks
Can you have look into this ? thanks a lot.
Hi @Simondebb , thanks for the reply, seems the issue is related to https://github.com/hashicorp/terraform-provider-azurerm/issues/18399. And the solution is in progress.
v3.32.0 - issue is still present
@teowa any update on that one or workaround?
Hi @hypery2k, We are working on a more general solution, which can cope with more situations (instead of a specific resource), and it may take longer time.
And a workaround to avoid diff and force replacement is to manually change the resource ID reference using replace function, for example:
resource "azurerm_monitor_diagnostic_setting" "aks-logging" {
target_resource_id = replace(azurerm_kubernetes_cluster.k8s.id, "resourceGroups", "resourcegroups")
}
Hope this may help.
thx for the hint, that worked
Hi @teowa , I have a similar issue and tried to use the replace function but didn't work. Although it's not an ID. resource_group_name = replace(var.someresourcegroup, "resourcegroups", "resourceGroups") any pointers on what I'm missing?
@aadesola , it is case by case, you should use the replace
function to replace the ID segment where you want to avoid unintentional change. Could you please provide more details on your Terraform plan
result? Maybe you should replace some property with ID format but not the resource_group_name
.
Is there an existing issue for this?
Community Note
Terraform Version
1.1.4
AzureRM Provider Version
3.26.0
Affected Resource(s)/Data Source(s)
azurerm_monitor_diagnostic_setting
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
azurerm_monitor_diagnostic_setting.aks-logging not changed
Actual Behaviour
azurerm_monitor_diagnostic_setting.aks-logging[0] must be replaced
The issue is ID casing - "resourceGroups" != "resourcegroups" in target_resource_id
Similar problem - #18467
Steps to Reproduce
No response
Important Factoids
No response
References
18467