Open rishab-sgid opened 1 year ago
@rcskosir, can someone help me with this issue ?
Adding that I'm seeing the same in 3.41.0. It appears that the capital C for "Clusters" was changed to a lower case c which is what is forcing an unintended replacement. Attempting to bold the issue below, but it's still hard to see.
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-name/providers/Microsoft.Kusto/Clusters/adxcluster" "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-name/providers/Microsoft.Kusto/clusters/adxcluster"
@schnabel45
Yes, I can clearly see the issue. But is there any workaround through which we can tackle this situation. If you find any solution, do let me know. I am still figuring out how can this be avoided.
@rishab-sgid Sorry I wasn't trying to say you didn't see the issue. It just took me a few minutes to realize what was going on so I wanted to point it out for everyone.
At this time, the only thing I can say is that the regression started in 3.35.0, I sequentially upgraded my provider from the version we had been running (3.32.0) until an apply started forcing a replacement. I'm not sure of a work around yet (outside of pinning the version to 3.34.0 for now).
I believe this is related to #19525. v3.35.0 introduced a kusto migration plan related to resource ID casing issues. I'm just now diving into the diff to see if anything stands out.
We run into this with resourceGroup
vs resourcegroup
in ARM ids. You could try.
locals {
your_resource_id = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg-name/providers/Microsoft.Kusto/clusters/adxcluster"
}
...
scope = replace(locals.your_resource_id , "clusters", "Clusters")
Which ever way you need the caps to work. Sometimes this lets the plan run cleanly. It is a hack until Terraform and Azure get their case consistent.
Is there an existing issue for this?
Community Note
Terraform Version
Terraform v1.5.2
AzureRM Provider Version
3.40.0
Affected Resource(s)/Data Source(s)
azurerm_management_lock
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Terraform resources mentioned in output should not have been replaced, they should not appear in output of terraform plan commands as no value is changed explicitly.
Actual Behaviour
Due to change in letters of scope, this is causing forceful replacement of resources. As seen below apart from highlighted words nothing have changed, this is causing our resources to destroy and reprovision
scope = "/subscriptions/xxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxx/resourceGroups/fsight-stg-rg-adx/providers/Microsoft.Kusto/Clusters/fsightstgkustocluster/Databases/fsight-stg-kusto-database" -> "/subscriptions/xxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxx/resourceGroups/fsight-stg-rg-adx/providers/Microsoft.Kusto/clusters/fsightstgkustocluster/databases/fsight-stg-kusto-database" # forces replacement
Steps to Reproduce
terraform init terraform plan
Important Factoids
Azurerm version used is terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "3.40.0" } } backend "azurerm" { } } provider "azurerm" { features {} skip_provider_registration = true } we are using Terraform OSS and state file is maintained remotely.
References
No response