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

chore: add io_com_action_group to fn-elt #1213

Merged
merged 5 commits into from
Oct 1, 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
5 changes: 5 additions & 0 deletions src/domains/elt/_modules/function_apps/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ data "azurerm_monitor_action_group" "error_action_group" {
resource_group_name = local.resource_group_name_common
}

data "azurerm_monitor_action_group" "io_com_action_group" {
name = "io-p-com-error-ag-01"
resource_group_name = "io-p-itn-msgs-rg-01"
}

data "azurerm_subnet" "snet_azdoa" {
name = "azure-devops"
virtual_network_name = var.vnet_name
Expand Down
4 changes: 4 additions & 0 deletions src/domains/elt/_modules/function_apps/function_app_elt.tf
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ module "function_elt" {
{
action_group_id = data.azurerm_monitor_action_group.error_action_group.id
webhook_properties = {}
},
{
action_group_id = data.azurerm_monitor_action_group.io_com_action_group.id
webhook_properties = {}
}
]

Expand Down
56 changes: 27 additions & 29 deletions src/domains/functions/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/domains/functions/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ data "azurerm_monitor_action_group" "error_action_group" {
resource_group_name = local.rg_common_name
}

data "azurerm_monitor_action_group" "io_com_action_group" {
name = "io-p-com-error-ag-01"
resource_group_name = "io-p-itn-msgs-rg-01"
}

data "azurerm_subnet" "ioweb_profile_snet" {
name = format("%s-%s-ioweb-profile-snet", local.project, var.location_short)
virtual_network_name = local.vnet_common_name
Expand Down
6 changes: 3 additions & 3 deletions src/domains/functions/function_admin.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ resource "azurerm_resource_group" "admin_rg" {

# Subnet to host admin function
module "admin_snet" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.67.1"
name = format("%s-admin-snet", local.project)
address_prefixes = var.cidr_subnet_fnadmin
resource_group_name = local.rg_common_name
Expand All @@ -196,7 +196,7 @@ module "admin_snet" {
}

module "function_admin" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.67.1"

resource_group_name = azurerm_resource_group.admin_rg.name
name = format("%s-admin-fn", local.project)
Expand Down Expand Up @@ -260,7 +260,7 @@ module "function_admin" {
}

module "function_admin_staging_slot" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.67.1"

name = "staging"
location = var.location
Expand Down
6 changes: 3 additions & 3 deletions src/domains/functions/function_app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ resource "azurerm_resource_group" "app_rg" {
# Subnet to host app function
module "app_snet" {
count = var.function_app_count
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.67.1"
name = format("%s-app-snet-%d", local.project, count.index + 1)
address_prefixes = [var.cidr_subnet_app[count.index]]
resource_group_name = local.rg_common_name
Expand Down Expand Up @@ -186,7 +186,7 @@ data "azurerm_subnet" "session_manager_snet" {
#tfsec:ignore:azure-storage-queue-services-logging-enabled:exp:2022-05-01 # already ignored, maybe a bug in tfsec
module "function_app" {
count = var.function_app_count
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.67.1"

resource_group_name = azurerm_resource_group.app_rg[count.index].name
name = format("%s-app-fn-%d", local.project, count.index + 1)
Expand Down Expand Up @@ -254,7 +254,7 @@ module "function_app" {

module "function_app_staging_slot" {
count = var.function_app_count
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.67.1"

name = "staging"
location = var.location
Expand Down
8 changes: 4 additions & 4 deletions src/domains/functions/function_app_async.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "azurerm_resource_group" "app_async_rg" {

# Subnet to host app function
module "app_async_snet" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.67.1"
name = format("%s-app-async-snet", local.project)
address_prefixes = var.cidr_subnet_app_async
resource_group_name = local.rg_common_name
Expand All @@ -45,7 +45,7 @@ module "app_async_snet" {

#tfsec:ignore:azure-storage-queue-services-logging-enabled:exp:2022-05-01 # already ignored, maybe a bug in tfsec
module "function_app_async" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.67.1"

resource_group_name = azurerm_resource_group.app_async_rg.name
name = format("%s-app-async-fn", local.project)
Expand Down Expand Up @@ -102,7 +102,7 @@ module "function_app_async" {
}

module "function_app_async_staging_slot" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.67.1"

name = "staging"
location = var.location
Expand Down Expand Up @@ -272,7 +272,7 @@ resource "azurerm_monitor_metric_alert" "function_app_async_health_check" {

# Cosmos container for subscription cidrs
module "db_subscription_profileemails_container" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//cosmosdb_sql_container?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//cosmosdb_sql_container?ref=v7.67.1"
name = "profile-emails-leases"
resource_group_name = format("%s-rg-internal", local.project)
account_name = format("%s-cosmos-api", local.project)
Expand Down
6 changes: 3 additions & 3 deletions src/domains/functions/function_assets_cdn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ locals {

# Subnet to host fn cdn assets function
module "function_assets_cdn_snet" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.67.1"
name = format("%s-assets-cdn-fn-snet", local.project)
address_prefixes = var.cidr_subnet_fncdnassets
resource_group_name = local.rg_common_name
Expand All @@ -59,7 +59,7 @@ module "function_assets_cdn_snet" {
}

module "function_assets_cdn" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.67.1"

resource_group_name = local.rg_assets_cdn_name
name = "${local.project}-assets-cdn-fn"
Expand Down Expand Up @@ -89,7 +89,7 @@ module "function_assets_cdn" {

module "function_assets_cdn_staging_slot" {
count = var.function_assets_cdn_sku_tier == "PremiumV3" ? 1 : 0
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.67.1"

name = "staging"
location = var.location
Expand Down
4 changes: 2 additions & 2 deletions src/domains/functions/function_public.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ locals {

#tfsec:ignore:azure-storage-queue-services-logging-enabled:exp:2022-05-01 # already ignored, maybe a bug in tfsec
module "function_public" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.67.1"

resource_group_name = azurerm_resource_group.shared_rg.name
name = format("%s-public-fn", local.project)
Expand Down Expand Up @@ -87,7 +87,7 @@ module "function_public" {
}

module "function_public_staging_slot" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.67.1"

name = "staging"
location = var.location
Expand Down
12 changes: 8 additions & 4 deletions src/domains/functions/function_services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ locals {
# Subnet to host app function
module "services_snet" {
count = var.function_services_count
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.67.1"
name = format("%s-services-snet-%d", local.project, count.index + 1)
address_prefixes = [var.cidr_subnet_services[count.index]]
resource_group_name = local.rg_common_name
Expand Down Expand Up @@ -168,7 +168,7 @@ resource "azurerm_resource_group" "services_rg" {
#tfsec:ignore:azure-storage-queue-services-logging-enabled:exp:2022-05-01 # already ignored, maybe a bug in tfsec
module "function_services" {
count = var.function_services_count
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.67.1"

domain = "IO-COMMONS"

Expand Down Expand Up @@ -243,6 +243,10 @@ module "function_services" {
{
action_group_id = data.azurerm_monitor_action_group.error_action_group.id
webhook_properties = null
},
{
action_group_id = data.azurerm_monitor_action_group.io_com_action_group.id
webhook_properties = null
}
]

Expand All @@ -259,7 +263,7 @@ module "function_services" {

module "function_services_staging_slot" {
count = var.function_services_count
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot?ref=v7.67.1"

name = "staging"
location = var.location
Expand Down Expand Up @@ -409,7 +413,7 @@ resource "azurerm_monitor_autoscale_setting" "function_services_autoscale" {

# Cosmos container for subscription cidrs
module "db_subscription_cidrs_container" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//cosmosdb_sql_container?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//cosmosdb_sql_container?ref=v7.67.1"
name = "subscription-cidrs"
resource_group_name = format("%s-rg-internal", local.project)
account_name = format("%s-cosmos-api", local.project)
Expand Down
2 changes: 1 addition & 1 deletion src/domains/functions/function_shared.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "azurerm_app_service_plan" "shared_1_plan" {

# Subnet to host app function
module "shared_1_snet" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.61.0"
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.67.1"
name = format("%s-shared-1-snet", local.project)
address_prefixes = var.cidr_subnet_shared_1
resource_group_name = local.rg_common_name
Expand Down
5 changes: 3 additions & 2 deletions src/domains/functions/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "<= 3.100.0"
version = "<= 3.97.1"
}
azuread = {
source = "hashicorp/azuread"
Expand All @@ -15,4 +15,5 @@ terraform {

provider "azurerm" {
features {}
}
}

5 changes: 5 additions & 0 deletions src/domains/messages-app/01_monitor.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ data "azurerm_monitor_action_group" "error_action_group" {
name = "${var.prefix}${var.env_short}error"
}

data "azurerm_monitor_action_group" "io_com_action_group" {
name = "io-p-com-error-ag-01"
resource_group_name = "io-p-itn-msgs-rg-01"
}

data "azurerm_monitor_action_group" "slack" {
resource_group_name = var.monitor_resource_group_name
name = local.monitor_action_group_slack_name
Expand Down
2 changes: 1 addition & 1 deletion src/domains/messages-app/07_function_pushnotif.tf
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ module "push_notif_function" {
# Action groups for alerts
action = [
{
action_group_id = data.azurerm_monitor_action_group.error_action_group.id
action_group_id = data.azurerm_monitor_action_group.io_com_action_group.id
webhook_properties = {}
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/domains/messages-app/11_function_cqrs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module "function_messages_cqrs" {

action = [
{
action_group_id = data.azurerm_monitor_action_group.error_action_group.id
action_group_id = data.azurerm_monitor_action_group.io_com_action_group.id
webhook_properties = null
}
]
Expand Down
1 change: 1 addition & 0 deletions src/domains/messages-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
| [azurerm_log_analytics_workspace.log_analytics](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/log_analytics_workspace) | data source |
| [azurerm_monitor_action_group.email](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/monitor_action_group) | data source |
| [azurerm_monitor_action_group.error_action_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/monitor_action_group) | data source |
| [azurerm_monitor_action_group.io_com_action_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/monitor_action_group) | data source |
| [azurerm_monitor_action_group.slack](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/monitor_action_group) | data source |
| [azurerm_notification_hub.common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/notification_hub) | data source |
| [azurerm_notification_hub.common_partition](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/notification_hub) | data source |
Expand Down
Loading