Skip to content

Commit

Permalink
Create sanitech_alerting.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH committed Apr 19, 2024
1 parent 84761e1 commit 8632be2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions func/sanitech_alerting.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
resource "azurerm_monitor_activity_log_alert" "example" {
name = "example-activity-log-alert"
location = "eastus"
resource_group_name = azurerm_resource_group.example.name
scopes = [data.azurerm_subscription.primary.id]

criteria {
category = "Administrative"
operation_name = "Microsoft.Compute/virtualMachines/write"
level = "Critical"
}

action {
action_group_id = azurerm_monitor_action_group.example.id
}
}

resource "azurerm_monitor_action_group" "example" {
name = "example-action-group"
resource_group_name = azurerm_resource_group.example.name
email_receiver {
name = "example-email"
email_address = "[email protected]"
use_common_alert_schema = true
}
}

resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "eastus"
}

data "azurerm_subscription" "primary" {}

0 comments on commit 8632be2

Please sign in to comment.