-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dependency parse of azurerm_kusto_cluster.id
#21243
Conversation
@@ -462,6 +463,8 @@ func resourceMonitorDiagnosticSettingRead(d *pluginsdk.ResourceData, meta interf | |||
return err | |||
} | |||
|
|||
id.ResourceUri = normalizeMonitorDiagnosticSettingTargetResourceId(id.ResourceUri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure why this is a function as its only used in a single place? can we inline it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @myc2h6o, one minor comment but otherwise this is looking good.
if strings.Contains(strings.ToLower(id.ResourceUri), "microsoft.kusto/clusters/") { | ||
if v, err := kustoParse.ClusterIDInsensitively(id.ResourceUri); err == nil { | ||
id.ResourceUri = v.ID() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be simplified to
if strings.Contains(strings.ToLower(id.ResourceUri), "microsoft.kusto/clusters/") { | |
if v, err := kustoParse.ClusterIDInsensitively(id.ResourceUri); err == nil { | |
id.ResourceUri = v.ID() | |
} | |
} | |
if v, err := kustoParse.ClusterIDInsensitively(id.ResourceUri); err == nil { | |
id.ResourceUri = v.ID() | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @myc2h6o LGTM 💯
This functionality has been released in v3.51.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I faced same issue but related to different service like azurerm_synapse_managed_private_endpoint and on server side there its Microsoft.Kusto/Clusters which was created by old provider version, after upgrade to 3.51.0 same issue persist and can not find any solution and workarounds so far.
Seems like issue was solved only on 'services/monitor/monitor_diagnostic_setting_resource' not globally or other services which could relate or referred. workaround its to use replace function with replace(azurerm_kusto_cluster.cluster.id, "clusters", "Clusters"). |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fix #20868
The segment
Clusters
in id ofazurerm_kusto_cluster
has been changed toclusters
in #19525. For other resources which has kusto cluster as part of its dependency created in older provider version, the segment is already set toClusters
at service side. This could cause a diff when provider is updated, whereazurerm_kusto_cluster.id
is auto migrated toclusters
in the state updater, while it's stillClusters
at service side. Fixing the diff by normalize the ID returned by service.