Skip to content

Add Action Group #125

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

Merged
merged 3 commits into from
Feb 10, 2024
Merged
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
16 changes: 16 additions & 0 deletions code/infra/alertinggroup.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "azurerm_monitor_action_group" "monitor_action_group" {
name = "${local.prefix}-ag001"
resource_group_name = azurerm_resource_group.logging_rg.name
tags = var.tags

enabled = true
short_name = substr(local.prefix, 0, 11)
dynamic "email_receiver" {
for_each = var.alert_endpoints.email == null ? [] : [1]
content {
name = local.prefix
email_address = email_receiver.value.email_address
use_common_alert_schema = true
}
}
}
2 changes: 1 addition & 1 deletion code/infra/function.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ resource "azapi_resource" "function" {
azureStorageAccounts = {}
detailedErrorLoggingEnabled = true
functionAppScaleLimit = 0
functionsRuntimeScaleMonitoringEnabled = true
functionsRuntimeScaleMonitoringEnabled = false
ftpsState = "Disabled"
healthCheckPath = var.function_health_path
http20Enabled = true
Expand Down
16 changes: 16 additions & 0 deletions code/infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ variable "my_secret" {
}
}

# Monitoring variables
variable "alert_endpoints" {
description = "Specifies the alert details."
type = object({
email = optional(object({
email_address = string
}), null)
})
sensitive = false
default = {}
validation {
condition = var.alert_endpoints == {} || length(var.alert_endpoints) > 0
error_message = "Please specify valid alert endpoints."
}
}

# Network variables
variable "vnet_id" {
description = "Specifies the resource ID of the Vnet used for the Azure Function."
Expand Down
3 changes: 3 additions & 0 deletions config/PerfectThymeTech/vars.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ vnet_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGr
nsg_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/networkSecurityGroups/mycrp-prd-function-nsg001"
route_table_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/routeTables/mycrp-prd-function-rt001"

# Monitoring variables
alert_endpoints = {}

# DNS variables
private_dns_zone_id_blob = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net"
private_dns_zone_id_queue = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.queue.core.windows.net"
Expand Down