From 224374c644112ddc933ae6ceaffd104e1711de7f Mon Sep 17 00:00:00 2001 From: Daniele Manni Date: Mon, 30 Sep 2024 17:05:47 +0200 Subject: [PATCH] [#IOPID-1987, IOPID-1989, IOPID-1988] LV Dependencies configuration --- src/common/prod/README.md | 1 + src/common/prod/data.tf | 6 ++++++ src/common/prod/westeurope.tf | 1 + src/domains/citizen-auth-app/08_session_manager.tf | 2 +- src/domains/citizen-auth-app/09_function_profile_async.tf | 4 ++-- src/domains/citizen-auth-common/03_apim_v2.tf | 6 +++--- src/domains/citizen-auth-common/99_locals.tf | 4 ++-- src/domains/citizen-auth-common/README.md | 2 +- .../citizen-auth-common/api/fast_login/v1/policy.xml | 2 +- src/domains/ioweb-app/06_function_ioweb_profile.tf | 2 +- 10 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/common/prod/README.md b/src/common/prod/README.md index 62fe9a0f7..eff52fb17 100644 --- a/src/common/prod/README.md +++ b/src/common/prod/README.md @@ -41,6 +41,7 @@ | [azurerm_subnet.admin_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.cosmos_api_allowed](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.functions_fast_login_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | +| [azurerm_subnet.itn_auth_fast_login_func_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.itn_msgs_sending_func_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.services_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_virtual_network.weu_beta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source | diff --git a/src/common/prod/data.tf b/src/common/prod/data.tf index d6fcb92e0..6fd99ccde 100644 --- a/src/common/prod/data.tf +++ b/src/common/prod/data.tf @@ -97,6 +97,12 @@ data "azurerm_subnet" "admin_snet" { virtual_network_name = local.core.networking.weu.vnet_common.name } +data "azurerm_subnet" "itn_auth_fast_login_func_snet" { + name = "${local.project_itn}-citizen-auth-fast-login-snet-01" + resource_group_name = local.core.networking.itn.vnet_common.resource_group_name + virtual_network_name = local.core.networking.itn.vnet_common.name +} + data "azurerm_subnet" "functions_fast_login_snet" { name = "${local.project_weu}-fast-login-snet" resource_group_name = local.core.networking.weu.vnet_common.resource_group_name diff --git a/src/common/prod/westeurope.tf b/src/common/prod/westeurope.tf index 846b74a2c..5af7c1263 100644 --- a/src/common/prod/westeurope.tf +++ b/src/common/prod/westeurope.tf @@ -480,6 +480,7 @@ module "app_backend_li_weu" { [ data.azurerm_subnet.admin_snet.id, data.azurerm_subnet.functions_fast_login_snet.id, + data.azurerm_subnet.itn_auth_fast_login_func_snet.id, data.azurerm_subnet.itn_msgs_sending_func_snet.id ]) slot_allowed_subnets = concat([local.azdoa_snet_id["weu"]], data.azurerm_subnet.services_snet.*.id, [data.azurerm_subnet.admin_snet.id]) diff --git a/src/domains/citizen-auth-app/08_session_manager.tf b/src/domains/citizen-auth-app/08_session_manager.tf index dc3c4719e..88167c9e6 100644 --- a/src/domains/citizen-auth-app/08_session_manager.tf +++ b/src/domains/citizen-auth-app/08_session_manager.tf @@ -137,7 +137,7 @@ locals { # Functions Fast Login config FAST_LOGIN_API_KEY = data.azurerm_key_vault_secret.functions_fast_login_api_key.value - FAST_LOGIN_API_URL = var.fastlogin_enabled ? "https://${module.function_fast_login[0].default_hostname}" : "" + FAST_LOGIN_API_URL = var.fastlogin_enabled ? "https://${module.function_fast_login_itn.default_hostname}" : "" # Functions Lollipop config LOLLIPOP_API_BASE_PATH = "/api/v1" diff --git a/src/domains/citizen-auth-app/09_function_profile_async.tf b/src/domains/citizen-auth-app/09_function_profile_async.tf index 333ed0cd4..1f639e99b 100644 --- a/src/domains/citizen-auth-app/09_function_profile_async.tf +++ b/src/domains/citizen-auth-app/09_function_profile_async.tf @@ -43,8 +43,8 @@ module "function_profile_async" { app_settings = merge( local.function_profile_async.app_settings_common, { "AzureWebJobs.MigrateServicePreferenceFromLegacy.Disabled" = "1", - "AzureWebJobs.StoreSpidLogs.Disabled" = "1", - "AzureWebJobs.OnProfileUpdate.Disabled" = "1", + "AzureWebJobs.StoreSpidLogs.Disabled" = "1", + "AzureWebJobs.OnProfileUpdate.Disabled" = "1", } ) diff --git a/src/domains/citizen-auth-common/03_apim_v2.tf b/src/domains/citizen-auth-common/03_apim_v2.tf index 88be30f33..2dadd61ba 100644 --- a/src/domains/citizen-auth-common/03_apim_v2.tf +++ b/src/domains/citizen-auth-common/03_apim_v2.tf @@ -236,11 +236,11 @@ data "azurerm_key_vault_secret" "functions_fast_login_api_key" { key_vault_id = module.key_vault.id } -resource "azurerm_api_management_named_value" "io_fn_weu_fast_login_operation_key_v2" { - name = "io-fn-weu-fast-login-operation-key" +resource "azurerm_api_management_named_value" "io_fn_itn_fast_login_operation_key_v2" { + name = "io-fn-itn-fast-login-operation-key" api_management_name = data.azurerm_api_management.apim_v2_api.name resource_group_name = data.azurerm_api_management.apim_v2_api.resource_group_name - display_name = "io-fn-weu-fast-login-operation-key" + display_name = "io-fn-itn-fast-login-operation-key" value = data.azurerm_key_vault_secret.functions_fast_login_api_key.value secret = "true" } diff --git a/src/domains/citizen-auth-common/99_locals.tf b/src/domains/citizen-auth-common/99_locals.tf index d31c32793..e5d5cabc7 100644 --- a/src/domains/citizen-auth-common/99_locals.tf +++ b/src/domains/citizen-auth-common/99_locals.tf @@ -20,8 +20,8 @@ locals { fast_login_backend_url = "https://%s/api/v1" # Fast Login references refers to src/domains/citizen-auth-app/07_functions_fast_login.tf - fn_fast_login_name = "${local.product}-weu-fast-login-fn" - fn_fast_login_resource_group_name = "${local.product}-weu-fast-login-rg" + fn_fast_login_name = "${local.common_project_itn}-auth-lv-fn-01" + fn_fast_login_resource_group_name = "${local.common_project_itn}-fast-login-rg-01" } # Region ITN diff --git a/src/domains/citizen-auth-common/README.md b/src/domains/citizen-auth-common/README.md index f4cc20a34..8b805821a 100644 --- a/src/domains/citizen-auth-common/README.md +++ b/src/domains/citizen-auth-common/README.md @@ -39,9 +39,9 @@ | [azurerm_api_management_group_user.pagopa_group_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_group_user) | resource | | [azurerm_api_management_group_user.pagopa_operation_group_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_group_user) | resource | | [azurerm_api_management_named_value.api_fast_login_operation_group_name](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_named_value) | resource | +| [azurerm_api_management_named_value.io_fn_itn_fast_login_operation_key_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_named_value) | resource | | [azurerm_api_management_named_value.io_fn_itn_lollipop_key_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_named_value) | resource | | [azurerm_api_management_named_value.io_fn_itn_lollipop_url_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_named_value) | resource | -| [azurerm_api_management_named_value.io_fn_weu_fast_login_operation_key_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_named_value) | resource | | [azurerm_api_management_subscription.pagopa_fastlogin_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_subscription) | resource | | [azurerm_api_management_subscription.pagopa_operation_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_subscription) | resource | | [azurerm_api_management_subscription.pagopa_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_subscription) | resource | diff --git a/src/domains/citizen-auth-common/api/fast_login/v1/policy.xml b/src/domains/citizen-auth-common/api/fast_login/v1/policy.xml index 98b878514..3fed4b92e 100644 --- a/src/domains/citizen-auth-common/api/fast_login/v1/policy.xml +++ b/src/domains/citizen-auth-common/api/fast_login/v1/policy.xml @@ -2,7 +2,7 @@ - {{io-fn-weu-fast-login-operation-key}} + {{io-fn-itn-fast-login-operation-key}} @(context.User.Id) diff --git a/src/domains/ioweb-app/06_function_ioweb_profile.tf b/src/domains/ioweb-app/06_function_ioweb_profile.tf index 3f90444e2..406adf33b 100644 --- a/src/domains/ioweb-app/06_function_ioweb_profile.tf +++ b/src/domains/ioweb-app/06_function_ioweb_profile.tf @@ -71,7 +71,7 @@ locals { // Fast Login config // ------------------------- FAST_LOGIN_API_KEY = data.azurerm_key_vault_secret.functions_fast_login_api_key.value - FAST_LOGIN_CLIENT_BASE_URL = "https://io-p-weu-fast-login-fn.azurewebsites.net" + FAST_LOGIN_CLIENT_BASE_URL = "https://io-p-itn-auth-lv-fn-01.azurewebsites.net" // ------------------------- // Functions App config