Skip to content

Commit b8c6073

Browse files
authored
Merge pull request #125 from PerfectThymeTech/marvinbuss/add_action_group
Add Action Group
2 parents 30a7990 + 9754997 commit b8c6073

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

code/infra/alertinggroup.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
resource "azurerm_monitor_action_group" "monitor_action_group" {
2+
name = "${local.prefix}-ag001"
3+
resource_group_name = azurerm_resource_group.logging_rg.name
4+
tags = var.tags
5+
6+
enabled = true
7+
short_name = substr(local.prefix, 0, 11)
8+
dynamic "email_receiver" {
9+
for_each = var.alert_endpoints.email == null ? [] : [1]
10+
content {
11+
name = local.prefix
12+
email_address = email_receiver.value.email_address
13+
use_common_alert_schema = true
14+
}
15+
}
16+
}

code/infra/function.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ resource "azapi_resource" "function" {
189189
azureStorageAccounts = {}
190190
detailedErrorLoggingEnabled = true
191191
functionAppScaleLimit = 0
192-
functionsRuntimeScaleMonitoringEnabled = true
192+
functionsRuntimeScaleMonitoringEnabled = false
193193
ftpsState = "Disabled"
194194
healthCheckPath = var.function_health_path
195195
http20Enabled = true

code/infra/variables.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@ variable "my_secret" {
102102
}
103103
}
104104

105+
# Monitoring variables
106+
variable "alert_endpoints" {
107+
description = "Specifies the alert details."
108+
type = object({
109+
email = optional(object({
110+
email_address = string
111+
}), null)
112+
})
113+
sensitive = false
114+
default = {}
115+
validation {
116+
condition = var.alert_endpoints == {} || length(var.alert_endpoints) > 0
117+
error_message = "Please specify valid alert endpoints."
118+
}
119+
}
120+
105121
# Network variables
106122
variable "vnet_id" {
107123
description = "Specifies the resource ID of the Vnet used for the Azure Function."

config/PerfectThymeTech/vars.tfvars

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ vnet_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGr
1616
nsg_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/networkSecurityGroups/mycrp-prd-function-nsg001"
1717
route_table_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-function-network-rg/providers/Microsoft.Network/routeTables/mycrp-prd-function-rt001"
1818

19+
# Monitoring variables
20+
alert_endpoints = {}
21+
1922
# DNS variables
2023
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"
2124
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"

0 commit comments

Comments
 (0)