Skip to content

Commit

Permalink
add standard names
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty93 committed Sep 4, 2024
1 parent f4b1748 commit fa8e97e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/common/_modules/monitoring/ag.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "azurerm_monitor_action_group" "error" {
resource_group_name = var.resource_group_common
name = local.nonstandard.weu.ag_error
short_name = local.nonstandard.weu.ag_error
name = try(local.nonstandard[var.location_short].ag_error, "${var.project}-error-ag-01")
short_name = try(local.nonstandard[var.location_short].ag_error, "${var.project}-error-ag-01")

email_receiver {
name = "email"
Expand All @@ -26,8 +26,8 @@ resource "azurerm_monitor_action_group" "error" {

resource "azurerm_monitor_action_group" "quarantine_error" {
resource_group_name = var.resource_group_common
name = local.nonstandard.weu.ag_quarantine_error
short_name = local.nonstandard.weu.ag_quarantine_error_short
name = try(local.nonstandard[var.location_short].ag_quarantine_error, "${var.project}-quarantineerror-ag-01")
short_name = try(local.nonstandard[var.location_short].ag_quarantine_error_short, "${var.project}-qerr-ag-01")

email_receiver {
name = "slack"
Expand All @@ -41,8 +41,8 @@ resource "azurerm_monitor_action_group" "quarantine_error" {
# the action group that publish to the channel of the trial-system project
resource "azurerm_monitor_action_group" "trial_system_error" {
resource_group_name = var.resource_group_common
name = local.nonstandard.weu.ag_ts_error
short_name = local.nonstandard.weu.ag_ts_error_short
name = try(local.nonstandard[var.location_short].ag_ts_error, "${var.project}-ts-error-ag-01")
short_name = try(local.nonstandard[var.location_short].ag_ts_error_short, "${var.project}-ts-error-ag-01")

email_receiver {
name = "slack"
Expand All @@ -54,9 +54,9 @@ resource "azurerm_monitor_action_group" "trial_system_error" {
}

resource "azurerm_monitor_action_group" "email" {
name = "EmailPagoPA"
name = try(local.nonstandard[var.location_short].email_pagopa, "${var.project}-email-ag-01")
resource_group_name = var.resource_group_common
short_name = "EmailPagoPA"
short_name = try(local.nonstandard[var.location_short].email_pagopa, "${var.project}-email-ag-01")

email_receiver {
name = "sendtooperations"
Expand All @@ -68,9 +68,9 @@ resource "azurerm_monitor_action_group" "email" {
}

resource "azurerm_monitor_action_group" "slack" {
name = "SlackPagoPA"
name = try(local.nonstandard[var.location_short].slack_pagopa, "${var.project}-slack-ag-01")
resource_group_name = var.resource_group_common
short_name = "SlackPagoPA"
short_name = try(local.nonstandard[var.location_short].slack_pagopa, "${var.project}-slack-ag-01")

email_receiver {
name = "sendtoslack"
Expand Down
2 changes: 1 addition & 1 deletion src/common/_modules/monitoring/appi.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "azurerm_application_insights" "appi" {
name = local.nonstandard[var.location_short].appi
name = try(local.nonstandard[var.location_short].appi, "${var.project}-appi-01")
location = var.location
resource_group_name = var.resource_group_common
disable_ip_masking = true
Expand Down
3 changes: 3 additions & 0 deletions src/common/_modules/monitoring/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ locals {

ag_ts_error = "${local.ag_formatted_project}trialsystemerror"
ag_ts_error_short = "${replace(var.project, "-", "")}tserr"

email_pagopa = "EmailPagoPA"
slack_pagopa = "SlackPagoPA"
}
}
}

0 comments on commit fa8e97e

Please sign in to comment.