Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

e96wic
Copy link

@e96wic e96wic commented Aug 17, 2019

Fixes #3719

Copy link
Collaborator

@katbyte katbyte left a 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?

@katbyte katbyte added this to the v1.34.0 milestone Aug 18, 2019
@katbyte katbyte changed the title Removed maxItems for AzureMonitorMetricAlert azurerm_monitor_metric_alert: Removed maxItems for the scope property Aug 18, 2019
@katbyte katbyte changed the title azurerm_monitor_metric_alert: Removed maxItems for the scope property azurerm_monitor_metric_alert: Removed maxItems for the scope property Aug 18, 2019
@ghost ghost added size/M documentation and removed size/XS labels Sep 1, 2019
"scopes": {
Type: schema.TypeSet,
Required: true,
MinItems: 1,
MaxItems: 1,
ForceNew: true,
Copy link
Author

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?

Copy link
Collaborator

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.

@e96wic e96wic closed this Sep 1, 2019
@e96wic e96wic reopened this Sep 1, 2019
@e96wic
Copy link
Author

e96wic commented Sep 1, 2019

@katbyte would you review again please?

@ghost ghost removed the waiting-response label Sep 1, 2019
Copy link
Collaborator

@katbyte katbyte left a 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": {
Copy link
Collaborator

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,
Copy link
Collaborator

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
Copy link
Collaborator

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.
Copy link
Collaborator

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?

@tombuildsstuff tombuildsstuff modified the milestones: v1.34.0, v1.35.0 Sep 13, 2019
@tombuildsstuff tombuildsstuff modified the milestones: v1.35.0, v1.36.0 Oct 1, 2019
@tombuildsstuff tombuildsstuff modified the milestones: v1.36.0, v1.37.0 Oct 22, 2019
@tombuildsstuff tombuildsstuff removed this from the v1.37.0 milestone Oct 31, 2019
@tombuildsstuff
Copy link
Contributor

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!

@ghost
Copy link

ghost commented Mar 29, 2020

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 ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow multiple scopes to be passed to Monitor MetricAlert resource
3 participants