Skip to content

Commit

Permalink
Merge pull request #1464 from CDCgov/azure-outage-alert-pain-and-suff…
Browse files Browse the repository at this point in the history
…ering

Setup Azure Alert for Azure is down
  • Loading branch information
jherrflexion authored Oct 22, 2024
2 parents a74ebc9 + 3b1b74b commit ebd3e21
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions operations/template/alert.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,47 @@ resource "azurerm_monitor_action_group" "notify_slack_email" {
}
}

resource "azurerm_monitor_activity_log_alert" "azure_service_health_alert" {
count = local.non_pr_environment ? 1 : 0
name = "cdcti-${var.environment}-azure-status-alert"
location = data.azurerm_resource_group.group.location
resource_group_name = data.azurerm_resource_group.group.name
scopes = ["/subscriptions/${data.azurerm_client_config.current.subscription_id}"]

criteria {
category = "ServiceHealth"
levels = ["Error"]
service_health {
locations = ["global"]
events = ["Incident"]
}
}

action {
action_group_id = azurerm_monitor_action_group.notify_slack_email[count.index].id
}

description = "Alert service(s) appear to be down"
enabled = true

lifecycle {
ignore_changes = [
tags["business_steward"],
tags["center"],
tags["environment"],
tags["escid"],
tags["funding_source"],
tags["pii_data"],
tags["security_compliance"],
tags["security_steward"],
tags["support_group"],
tags["system"],
tags["technical_steward"],
tags["zone"]
]
}
}

resource "azurerm_monitor_scheduled_query_rules_alert" "database_token_expired_alert" {
count = local.non_pr_environment ? 1 : 0
name = "cdcti-${var.environment}-api-log-token-alert"
Expand Down

0 comments on commit ebd3e21

Please sign in to comment.