-
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
azurerm_monitor_metric_alert
: Removed maxItems for the scope
property
#4111
Conversation
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.
Hi @e96wic,
Thank you for this PR. Could we get a new test with multiple alerts and update the documentation to reflect the change?
scope
property
scope
propertyazurerm_monitor_metric_alert
: Removed maxItems for the scope
property
"scopes": { | ||
Type: schema.TypeSet, | ||
Required: true, | ||
MinItems: 1, | ||
MaxItems: 1, | ||
ForceNew: true, |
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.
we only need to recreate the resource in some occasions, is it possible to make this conditional?
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 is a breaking change? And I believe you can do this via CustomizeDiff but i'm not sure how exactly to do it.
@katbyte would you review again please? |
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 the changes @e96wic,
Could we add a test with the new properties you've added? target resource type & region?
@@ -37,16 +37,25 @@ func resourceArmMonitorMetricAlert() *schema.Resource { | |||
ValidateFunc: validate.NoEmptyStrings, | |||
}, | |||
|
|||
"target_resource_type": { |
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 looks unrelated to removing the max items property? PR title might warrant updating?
"scopes": { | ||
Type: schema.TypeSet, | ||
Required: true, | ||
MinItems: 1, | ||
MaxItems: 1, | ||
ForceNew: true, |
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 is a breaking change? And I believe you can do this via CustomizeDiff but i'm not sure how exactly to do it.
metricData = append(metricData, *metricCriteria) | ||
} | ||
} else { | ||
metricData = *criteria.AllOf |
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 think you'll need the nil checkes here?
@@ -70,6 +70,8 @@ The following arguments are supported: | |||
* `name` - (Required) The name of the Metric Alert. Changing this forces a new resource to be created. | |||
* `resource_group_name` - (Required) The name of the resource group in which to create the Metric Alert instance. | |||
* `scopes` - (Required) The resource ID at which the metric criteria should be applied. |
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.
Could we update this to reflect multiple can now be used?
hey @e96wic Whilst I'd like to thank you for this contribution - since there's some outstanding comments and we've not heard back from you here, rather than leaving this PR open indefinitely I'm going to close this PR for the moment. That said if you (or someone else) is able to finish this off then we're more than happy to take another look and get this merged :) Thanks! |
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! |
Fixes #3719