azurerm_monitor_smart_detector_alert_rule

Manages an Monitor Smart Detector Alert Rule.

Example Usage

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

resource "azurerm_application_insights" "example" {
  name                = "example-appinsights"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  application_type    = "web"
}

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

resource "azurerm_monitor_smart_detector_alert_rule" "example" {
  name                = "example-smart-detector-alert-rule"
  resource_group_name = azurerm_resource_group.example.name
  severity            = "Sev0"
  scope_resource_ids  = [azurerm_application_insights.example.id]
  frequency           = "PT1M"
  detector_type       = "FailureAnomaliesDetector"

  action_group {
    ids = [azurerm_monitor_action_group.example.id]
  }
}

Argument Reference

The following arguments are supported:


The action_group 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

Monitor Smart Detector Alert Rule can be imported using the resource id, e.g.

terraform import azurerm_monitor_smart_detector_alert_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/rule1