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_resource: keep using SingleResourceMultiMetricCriteria for legacy metric alerts #7995

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented Aug 4, 2020

The change in #7159 deprecates the usage of SingleResourceMultiMetricCriteria outright (replaced by MultipleResourceMultipleMetricCriteria). Unfortunately, that breaks the users who have metric alert created before that PR merged, which was using SingleResourceMultiMetricCriteria as its type. Then once those metric alerts get updated, current code will trigger an update from SingleResourceMultiMetricCriteria to MultipleResourceMultipleMetricCriteria, which seems not supported by service (as reported in #7910).

This PR keeps those legacy resource to use the SingleResourceMultiMetricCriteria. If user wants to use the MultipleResourceMultipleMetricCriteria, they will have to recreate the resource.

(fixes #7910)

Test Result

💢 make testacc TEST=./azurerm/internal/services/monitor/tests TESTARGS='-run TestAccAzureRMMonitorMetricAlert_'

==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test ./azurerm/internal/services/monitor/tests -v -run TestAccAzureRMMonitorMetricAlert_ -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAzureRMMonitorMetricAlert_basic
=== PAUSE TestAccAzureRMMonitorMetricAlert_basic
=== RUN   TestAccAzureRMMonitorMetricAlert_requiresImport
=== PAUSE TestAccAzureRMMonitorMetricAlert_requiresImport
=== RUN   TestAccAzureRMMonitorMetricAlert_complete
=== PAUSE TestAccAzureRMMonitorMetricAlert_complete
=== RUN   TestAccAzureRMMonitorMetricAlert_basicAndCompleteUpdate
=== PAUSE TestAccAzureRMMonitorMetricAlert_basicAndCompleteUpdate
=== RUN   TestAccAzureRMMonitorMetricAlert_multiScope
=== PAUSE TestAccAzureRMMonitorMetricAlert_multiScope
=== RUN   TestAccAzureRMMonitorMetricAlert_applicationInsightsWebTest
=== PAUSE TestAccAzureRMMonitorMetricAlert_applicationInsightsWebTest
=== CONT  TestAccAzureRMMonitorMetricAlert_basic
=== CONT  TestAccAzureRMMonitorMetricAlert_multiScope
=== CONT  TestAccAzureRMMonitorMetricAlert_applicationInsightsWebTest
=== CONT  TestAccAzureRMMonitorMetricAlert_requiresImport
=== CONT  TestAccAzureRMMonitorMetricAlert_basicAndCompleteUpdate
=== CONT  TestAccAzureRMMonitorMetricAlert_complete
--- PASS: TestAccAzureRMMonitorMetricAlert_complete (167.69s)
--- PASS: TestAccAzureRMMonitorMetricAlert_basic (167.70s)
--- PASS: TestAccAzureRMMonitorMetricAlert_requiresImport (180.59s)
--- PASS: TestAccAzureRMMonitorMetricAlert_applicationInsightsWebTest (181.70s)
--- PASS: TestAccAzureRMMonitorMetricAlert_basicAndCompleteUpdate (393.81s)
--- PASS: TestAccAzureRMMonitorMetricAlert_multiScope (647.77s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/monitor/tests       647.820s

@ghost ghost added the size/M label Aug 4, 2020
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.

LGTM 👍

@katbyte katbyte added this to the v2.23.0 milestone Aug 11, 2020
@katbyte katbyte merged commit 89784d2 into hashicorp:master Aug 11, 2020
katbyte added a commit that referenced this pull request Aug 11, 2020
@ghost
Copy link

ghost commented Aug 13, 2020

This has been released in version 2.23.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.23.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Sep 10, 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 Sep 10, 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.

Monitor alerts for AKS failing in the latest AzureRM version
2 participants