Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added activity-log alerts #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions services/activity-log/alert/v1/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "azurerm_monitor_activity_log_alert" "activity_log_alert" {

name = var.service_settings.name
resource_group_name = var.context.resource_group_name
scopes = [var.service_settings.scope]
description = var.service_settings.description

criteria {
operation_name = var.service_settings.operation_name
category = var.service_settings.category
}

action {
action_group_id = var.service_settings.action_group_id
}

}
26 changes: 26 additions & 0 deletions services/activity-log/alert/v1/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
variable "context" {
type = object({

application_name = string
environment_name = string
resource_group_name = string

location = object({
name = string
suffix = string
number = number
})

})
}

variable "service_settings" {
type = object({
name = string
description = string
scope = string
operation_name = string
category = string
action_group_id = string
})
}
17 changes: 17 additions & 0 deletions services/activity-log/alert/v1/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 2.45.0"
}
null = {
source = "hashicorp/null"
version = "~> 3.0.0"
}
time = {
source = "hashicorp/time"
version = "~> 0.6.0"
}
}
required_version = ">= 0.13"
}