azurerm_monitor_alert_processing_rule_action_group

Manages an Alert Processing Rule which apply action group.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_monitor_action_group" "example" {
  name                = "example-action-group"
  resource_group_name = azurerm_resource_group.example.name
  short_name          = "action"
}

resource "azurerm_monitor_alert_processing_rule_action_group" "example" {
  name                 = "example"
  resource_group_name  = "example"
  scopes               = [azurerm_resource_group.example.id]
  add_action_group_ids = [azurerm_monitor_action_group.example.id]

  condition {
    target_resource_type {
      operator = "Equals"
      values   = ["Microsoft.Compute/VirtualMachines"]
    }
    severity {
      operator = "Equals"
      values   = ["Sev0", "Sev1", "Sev2"]
    }
  }

  schedule {
    effective_from  = "2022-01-01T01:02:03"
    effective_until = "2022-02-02T01:02:03"
    time_zone       = "Pacific Standard Time"
    recurrence {
      daily {
        start_time = "17:00:00"
        end_time   = "09:00:00"
      }
      weekly {
        days_of_week = ["Saturday", "Sunday"]
      }
    }
  }

  tags = {
    foo = "bar"
  }
}

Arguments Reference

The following arguments are supported:



A alert_context block supports the following:


A alert_rule_id block supports the following:


A alert_rule_name block supports the following:


A condition block supports the following:


A daily block supports the following:


A description block supports the following:


A monitor_condition block supports the following:


A monitor_service block supports the following:


A monthly block supports the following:


A recurrence block supports the following:


A schedule block supports the following:


A severity block supports the following:


A signal_type block supports the following:


A target_resource block supports the following:


A target_resource_group block supports the following:


A target_resource_type block supports the following:


A weekly block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Alert Processing Rules can be imported using the resource id, e.g.

terraform import azurerm_monitor_alert_processing_rule_action_group.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.AlertsManagement/actionRules/actionRule1