You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some resources in azure have space in them. This generates bad TF and errors when doing terraform apply
TF code:
resource "azurerm_monitor_smart_detector_alert_rule" "res-486" {
description = "Failure Anomalies notifies you of an unusual rise in the rate of failed HTTP requests or dependency calls."
detector_type = "FailureAnomaliesDetector"
frequency = "PT1M"
name = "Failure Anomalies - REMOVED"
resource_group_name = "REMOVED"
scope_resource_ids = ["/subscriptions/REMOVED/resourcegroups/REMOVED/providers/microsoft.insights/components/REMOVED"]
severity = "Sev3"
action_group {
ids = ["/subscriptions/REMOVED/resourcegroups/REMOVED/providers/microsoft.insights/actiongroups/application insights smart detection"]
}
depends_on = [
azurerm_resource_group.res-0,
]
}
TF apply response:
Error: ID was missing the `actionGroups` element
│
│ with azurerm_monitor_smart_detector_alert_rule.res-486,
│ on main.tf line 837, in resource "azurerm_monitor_smart_detector_alert_rule" "res-486":
│ 837: ids = ["/subscriptions/REMOVED/resourcegroups/REMOVED/providers/microsoft.insights/actiongroups/application insights smart detection"]
I have tried replacing the space with + and %20 but it still fails.
@emilwester-optimizely Thank you for submitting this! The issue is not caused by the empty space in the resource name, but the casing of the element in the ids array. The only change needed to make this work is to modify the actiongroups to actionGroups.
Some resources in azure have space in them. This generates bad TF and errors when doing terraform apply
TF code:
TF apply response:
I have tried replacing the space with + and %20 but it still fails.
this is related to:
Azure/azure-cli#12885
but there is a workaround in comment:
Azure/azure-cli#12885 (comment)
Can we implement a similar workaround until fixed?
The text was updated successfully, but these errors were encountered: