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

On metric alert rule creation, the 'autoMitigate' property should be set to true by default #5773

Merged
merged 1 commit into from
Feb 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func resourceArmMonitorMetricAlert() *schema.Resource {
"auto_mitigate": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Default: true,
tombuildsstuff marked this conversation as resolved.
Show resolved Hide resolved
},

"description": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestAccAzureRMMonitorMetricAlert_complete(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMMonitorMetricAlertExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "enabled", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "auto_mitigate", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "auto_mitigate", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "severity", "4"),
resource.TestCheckResourceAttr(data.ResourceName, "description", "This is a complete metric alert resource."),
resource.TestCheckResourceAttr(data.ResourceName, "frequency", "PT30M"),
Expand Down Expand Up @@ -128,7 +128,7 @@ func TestAccAzureRMMonitorMetricAlert_basicAndCompleteUpdate(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMMonitorMetricAlertExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "enabled", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "auto_mitigate", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "auto_mitigate", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "severity", "3"),
resource.TestCheckResourceAttr(data.ResourceName, "description", ""),
resource.TestCheckResourceAttr(data.ResourceName, "frequency", "PT1M"),
Expand All @@ -149,7 +149,7 @@ func TestAccAzureRMMonitorMetricAlert_basicAndCompleteUpdate(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMMonitorMetricAlertExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "enabled", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "auto_mitigate", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "auto_mitigate", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "severity", "4"),
resource.TestCheckResourceAttr(data.ResourceName, "description", "This is a complete metric alert resource."),
resource.TestCheckResourceAttr(data.ResourceName, "frequency", "PT30M"),
Expand Down Expand Up @@ -184,7 +184,7 @@ func TestAccAzureRMMonitorMetricAlert_basicAndCompleteUpdate(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMMonitorMetricAlertExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "enabled", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "auto_mitigate", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "auto_mitigate", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "severity", "3"),
resource.TestCheckResourceAttr(data.ResourceName, "description", ""),
resource.TestCheckResourceAttr(data.ResourceName, "frequency", "PT1M"),
Expand Down Expand Up @@ -288,7 +288,7 @@ resource "azurerm_monitor_metric_alert" "test" {
resource_group_name = "${azurerm_resource_group.test.name}"
scopes = ["${azurerm_storage_account.test.id}"]
enabled = true
auto_mitigate = true
auto_mitigate = false
severity = 4
description = "This is a complete metric alert resource."
frequency = "PT30M"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/monitor_metric_alert.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The following arguments are supported:
* `criteria` - (Required) One or more `criteria` blocks as defined below.
* `action` - (Optional) One or more `action` blocks as defined below.
* `enabled` - (Optional) Should this Metric Alert be enabled? Defaults to `true`.
* `auto_mitigate` - (Optional) Should the alerts in this Metric Alert be auto resolved? Defaults to `false`.
* `auto_mitigate` - (Optional) Should the alerts in this Metric Alert be auto resolved? Defaults to `true`.
* `description` - (Optional) The description of this Metric Alert.
* `frequency` - (Optional) The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are `PT1M`, `PT5M`, `PT15M`, `PT30M` and `PT1H`. Defaults to `PT1M`.
* `severity` - (Optional) The severity of this Metric Alert. Possible values are `0`, `1`, `2`, `3` and `4`. Defaults to `3`.
Expand Down