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
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform (and AzureRM Provider) Version
Terraform v0.12.24
+ provider.azurerm v2.9.0
Affected Resource(s)
azurerm_monitor_metric_alert
Terraform Configuration Files
Example:
resource"azurerm_monitor_metric_alert""mon_metric_alert" {
name="AppService-diskSpace-Sev1"resource_group_name=azurerm_resource_group.location1[0].namescopes=["/subscriptions/93888cb3-6d3e-4f81-806b-55a19356d689/resourceGroups/rg-company-vm-ad/providers/Microsoft.Compute/virtualMachines/vm-company-ad01",
"/subscriptions/93888cb3-6d3e-4f81-806b-55a19356d689/resourceGroups/rg-company-vm-adds/providers/Microsoft.Compute/virtualMachines/vm-company-vmdc01"]
description="Disk space over 90 percent"window_size="PT6H"frequency="PT1H"criteria {
metric_namespace="Microsoft.Web/sites"metric_name="FileSystemUsage"aggregation="Average"operator="GreaterThan"threshold=241591910400# 90% of 250Gb in bytes
}
severity=1
}
Debug Output
None
Panic Output
None
Expected Behavior
Create the metric alert for both scopes in the list.
Actual Behavior
Error message that only 1 item is supported for the scopes attribute.
Error: scopes: attribute supports 1 item maximum, config has 2 declared
on ..\..\..\..\Modules\Azure\MON\MON_Metric_Alert\main.tf line 5, in resource "azurerm_monitor_metric_alert" "mon_metric_alert":
5: resource "azurerm_monitor_metric_alert" "mon_metric_alert" {
But the scopes attribute is declared as " A set of strings of resource IDs at which the metric criteria should be applied."
Therefore, multiple values in the list must be possible.
Thank you for letting us know this issue 👍
This is a historical issue that Azure Go SDK doesn't support multiple scopes at the early version, so we added a max item limit to 1 to avoid the potential error. However, this is not the case for now.
There is already an issue #3719 to track to support multiple scopes, which you can subscribe to for any update. I hope you don't mind that I close this issue reducing duplication.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
ghost
locked and limited conversation to collaborators
Jun 25, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_monitor_metric_alert
Terraform Configuration Files
Example:
Debug Output
None
Panic Output
None
Expected Behavior
Create the metric alert for both
scopes
in the list.Actual Behavior
Error message that only 1 item is supported for the
scopes
attribute.But the
scopes
attribute is declared as " A set of strings of resource IDs at which the metric criteria should be applied."Therefore, multiple values in the list must be possible.
Steps to Reproduce
terraform apply
Important Factoids
References
https://stackoverflow.com/questions/60812471/using-splat-operator-in-terraform-azurerm-monitor-metric-alert-scope-setting
The text was updated successfully, but these errors were encountered: