Files
Jonathan Boniface bc84ee4df6
Some checks failed
check agents / check (push) Failing after 13s
Solution architecture outcome pattern: agent and its MCP servers
The cp1-solution-architecture-agent and the sa-aws/azure/gcp-cloud MCP servers, a separate
stream from the individual and sub-agent patterns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:13:25 +00:00

1.0 KiB

Azure Monitor alert

A metric alert routed to an action group. scopes is the resource being watched.

variable "watched_id" {
  type = string
}

variable "on_call_email" {
  type = string
}

resource "azurerm_monitor_action_group" "on_call" {
  name                = "ag-on-call"
  resource_group_name = var.resource_group_name
  short_name          = "oncall"

  email_receiver {
    name          = "on-call"
    email_address = var.on_call_email
  }
}

resource "azurerm_monitor_metric_alert" "cpu" {
  name                = "alert-cpu"
  resource_group_name = var.resource_group_name
  scopes              = [var.watched_id]
  severity            = 2
  frequency           = "PT5M"
  window_size         = "PT15M"

  criteria {
    metric_namespace = "Microsoft.DBforPostgreSQL/flexibleServers"
    metric_name      = "cpu_percent"
    aggregation      = "Average"
    operator         = "GreaterThan"
    threshold        = 80
  }

  action {
    action_group_id = azurerm_monitor_action_group.on_call.id
  }
}