diff --git a/src/common/prod/README.md b/src/common/prod/README.md index dc7c44a36..9ded9379e 100644 --- a/src/common/prod/README.md +++ b/src/common/prod/README.md @@ -31,9 +31,9 @@ | [azurerm_api_management.trial_system](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/api_management) | data source | | [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source | | [azurerm_linux_function_app.eucovidcert](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source | -| [azurerm_linux_function_app.function_app](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source | | [azurerm_linux_function_app.function_assets_cdn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source | | [azurerm_linux_function_app.function_cgn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source | +| [azurerm_linux_function_app.function_profile](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source | | [azurerm_linux_function_app.io_sign_user](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source | | [azurerm_linux_function_app.lollipop_function](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source | | [azurerm_linux_function_app.services_app_backend_function_app](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_function_app) | data source | diff --git a/src/common/prod/data.tf b/src/common/prod/data.tf index 6fd99ccde..04696b3c1 100644 --- a/src/common/prod/data.tf +++ b/src/common/prod/data.tf @@ -49,10 +49,10 @@ data "azurerm_linux_function_app" "function_assets_cdn" { resource_group_name = "${local.project_weu_legacy}-assets-cdn-rg" } -data "azurerm_linux_function_app" "function_app" { - count = local.function_app_count - name = "${local.project_weu_legacy}-app-fn-${count.index + 1}" - resource_group_name = "${local.project_weu_legacy}-app-rg-${count.index + 1}" +data "azurerm_linux_function_app" "function_profile" { + count = local.function_profile_count + name = "${local.project_itn}-auth-profile-fn-0${count.index + 1}" + resource_group_name = "${local.project_itn}-profile-rg-0${count.index + 1}" } data "azurerm_linux_function_app" "services_app_backend_function_app" { @@ -113,4 +113,5 @@ data "azurerm_subnet" "itn_msgs_sending_func_snet" { name = "${local.project_itn}-msgs-sending-func-snet-01" resource_group_name = local.core.networking.itn.vnet_common.resource_group_name virtual_network_name = local.core.networking.itn.vnet_common.name -} \ No newline at end of file +} + diff --git a/src/common/prod/locals.tf b/src/common/prod/locals.tf index 2e6129b07..f95172ded 100644 --- a/src/common/prod/locals.tf +++ b/src/common/prod/locals.tf @@ -17,7 +17,7 @@ locals { core = data.terraform_remote_state.core.outputs - function_app_count = 2 + function_profile_count = 2 # TODO: edit this block when resource groups module is implemented resource_groups = { @@ -50,7 +50,7 @@ locals { app_settings_override = { IS_APPBACKENDLI = "false" // FUNCTIONS - API_URL = "https://${data.azurerm_linux_function_app.function_app[1].default_hostname}/api/v1" + API_URL = "https://${data.azurerm_linux_function_app.function_profile[1].default_hostname}/api/v1" APP_MESSAGES_API_URL = "https://io-p-app-messages-fn-1.azurewebsites.net/api/v1" } }, @@ -59,7 +59,7 @@ locals { app_settings_override = { IS_APPBACKENDLI = "false" // FUNCTIONS - API_URL = "https://${data.azurerm_linux_function_app.function_app[1].default_hostname}/api/v1" + API_URL = "https://${data.azurerm_linux_function_app.function_profile[1].default_hostname}/api/v1" APP_MESSAGES_API_URL = "https://io-p-app-messages-fn-2.azurewebsites.net/api/v1" } } @@ -70,7 +70,7 @@ locals { app_settings_override = { IS_APPBACKENDLI = "true" // FUNCTIONS - API_URL = "https://${data.azurerm_linux_function_app.function_app[1].default_hostname}/api/v1" # not used + API_URL = "https://${data.azurerm_linux_function_app.function_profile[1].default_hostname}/api/v1" APP_MESSAGES_API_URL = "https://io-p-app-messages-fn-1.azurewebsites.net/api/v1" } } @@ -275,4 +275,5 @@ locals { ] } ] -} \ No newline at end of file +} + diff --git a/src/domains/citizen-auth-app/08_session_manager.tf b/src/domains/citizen-auth-app/08_session_manager.tf index 9d3e21f1f..3d0fe7303 100644 --- a/src/domains/citizen-auth-app/08_session_manager.tf +++ b/src/domains/citizen-auth-app/08_session_manager.tf @@ -133,7 +133,7 @@ locals { # Functions App config API_KEY = data.azurerm_key_vault_secret.functions_app_api_key.value - API_URL = "https://io-p-app-fn-1.azurewebsites.net" + API_URL = "https://io-p-itn-auth-profile-fn-01.azurewebsites.net" # Functions Fast Login config FAST_LOGIN_API_KEY = data.azurerm_key_vault_secret.functions_fast_login_api_key.value diff --git a/src/domains/ioweb-app/01_network_itn.tf b/src/domains/ioweb-app/01_network_itn.tf new file mode 100644 index 000000000..08d2a0f98 --- /dev/null +++ b/src/domains/ioweb-app/01_network_itn.tf @@ -0,0 +1,11 @@ +data "azurerm_virtual_network" "common_vnet_italy_north" { + name = format("%s-itn-common-vnet-01", local.product) + resource_group_name = data.azurerm_resource_group.italy_north_common_rg.name +} + +data "azurerm_subnet" "function_profile_snet" { + count = 2 + name = format("%s-itn-auth-profile-snet-0%d", local.product, count.index + 1) + virtual_network_name = data.azurerm_virtual_network.common_vnet_italy_north.name + resource_group_name = data.azurerm_virtual_network.common_vnet_italy_north.resource_group_name +} diff --git a/src/domains/ioweb-app/05_resource_group.tf b/src/domains/ioweb-app/05_resource_group.tf index fb7e54cd4..0fa8ac087 100644 --- a/src/domains/ioweb-app/05_resource_group.tf +++ b/src/domains/ioweb-app/05_resource_group.tf @@ -16,3 +16,7 @@ resource "azurerm_resource_group" "ioweb_profile_rg" { data "azurerm_resource_group" "storage_rg" { name = "${local.common_project}-${var.domain}-storage-rg" } + +data "azurerm_resource_group" "italy_north_common_rg" { + name = format("%s-itn-common-rg-01", local.product) +} diff --git a/src/domains/ioweb-app/06_function_ioweb_profile.tf b/src/domains/ioweb-app/06_function_ioweb_profile.tf index 406adf33b..5db43c936 100644 --- a/src/domains/ioweb-app/06_function_ioweb_profile.tf +++ b/src/domains/ioweb-app/06_function_ioweb_profile.tf @@ -77,7 +77,7 @@ locals { // Functions App config // ------------------------- FUNCTIONS_APP_API_KEY = data.azurerm_key_vault_secret.functions_app_api_key.value - FUNCTIONS_APP_CLIENT_BASE_URL = "https://io-p-app-fn-2.azurewebsites.net" + FUNCTIONS_APP_CLIENT_BASE_URL = "https://io-p-itn-auth-profile-fn-02.azurewebsites.net" // ------------------------- // Hub Spid Login for ioweb config @@ -166,6 +166,8 @@ module "function_ioweb_profile" { data.azurerm_subnet.apim_v2_snet.id, data.azurerm_subnet.function_app_snet[0].id, data.azurerm_subnet.function_app_snet[1].id, + data.azurerm_subnet.function_profile_snet[0].id, + data.azurerm_subnet.function_profile_snet[1].id, ] enable_healthcheck = false @@ -212,6 +214,8 @@ module "function_ioweb_profile_staging_slot" { data.azurerm_subnet.apim_v2_snet.id, data.azurerm_subnet.function_app_snet[0].id, data.azurerm_subnet.function_app_snet[1].id, + data.azurerm_subnet.function_profile_snet[0].id, + data.azurerm_subnet.function_profile_snet[1].id, ] tags = var.tags diff --git a/src/domains/ioweb-app/README.md b/src/domains/ioweb-app/README.md index c93b96b7b..15dfaf1e9 100644 --- a/src/domains/ioweb-app/README.md +++ b/src/domains/ioweb-app/README.md @@ -64,6 +64,7 @@ | [azurerm_private_dns_zone.privatelink_file_core_windows_net](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/private_dns_zone) | data source | | [azurerm_private_dns_zone.privatelink_queue_core_windows_net](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/private_dns_zone) | data source | | [azurerm_private_dns_zone.privatelink_table_core_windows_net](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/private_dns_zone) | data source | +| [azurerm_resource_group.italy_north_common_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source | | [azurerm_resource_group.monitor_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source | | [azurerm_resource_group.storage_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source | | [azurerm_storage_account.immutable_spid_logs_storage](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/storage_account) | data source | @@ -71,8 +72,10 @@ | [azurerm_subnet.apim_v2_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.azdoa_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.function_app_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | +| [azurerm_subnet.function_profile_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.private_endpoints_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subscription.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription) | data source | +| [azurerm_virtual_network.common_vnet_italy_north](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source | | [azurerm_virtual_network.vnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source | | [azurerm_virtual_network.vnet_common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source |