diff --git a/src/common/_modules/cosmos_api/networking.tf b/src/common/_modules/cosmos_api/networking.tf index a380d2061..da68615fa 100644 --- a/src/common/_modules/cosmos_api/networking.tf +++ b/src/common/_modules/cosmos_api/networking.tf @@ -19,3 +19,20 @@ resource "azurerm_private_endpoint" "sql" { tags = var.tags } + +resource "azurerm_private_endpoint" "sql_itn" { + + name = "${var.project}-itn-api-cosno-pep-01" + location = "italynorth" + resource_group_name = azurerm_cosmosdb_account.this.resource_group_name + subnet_id = var.secondary_location_pep_snet_id + + private_service_connection { + name = "${var.project}-itn-api-cosno-pep-01" + private_connection_resource_id = azurerm_cosmosdb_account.this.id + is_manual_connection = false + subresource_names = ["Sql"] + } + + tags = var.tags +} diff --git a/src/common/_modules/cosmos_api/variables.tf b/src/common/_modules/cosmos_api/variables.tf index ab0f04b14..e6cb6c372 100644 --- a/src/common/_modules/cosmos_api/variables.tf +++ b/src/common/_modules/cosmos_api/variables.tf @@ -48,6 +48,11 @@ variable "secondary_location" { default = null } +variable "secondary_location_pep_snet_id" { + type = string + description = "Id of the subnet holding private endpoints in the secondary location" +} + variable "documents_dns_zone" { type = object({ id = string diff --git a/src/common/prod/westeurope.tf b/src/common/prod/westeurope.tf index eb84da856..614767876 100644 --- a/src/common/prod/westeurope.tf +++ b/src/common/prod/westeurope.tf @@ -385,12 +385,13 @@ module "cosmos_api_weu" { location_short = local.core.resource_groups.westeurope.location_short project = local.project_weu_legacy - resource_group_internal = local.core.resource_groups.westeurope.internal - vnet_common = local.core.networking.weu.vnet_common - pep_snet = local.core.networking.weu.pep_snet - secondary_location = "northeurope" - documents_dns_zone = module.global.dns.private_dns_zones.documents - allowed_subnets_ids = values(data.azurerm_subnet.cosmos_api_allowed)[*].id + resource_group_internal = local.core.resource_groups.westeurope.internal + vnet_common = local.core.networking.weu.vnet_common + pep_snet = local.core.networking.weu.pep_snet + secondary_location = "italynorth" + secondary_location_pep_snet_id = local.core.networking.itn.pep_snet.id + documents_dns_zone = module.global.dns.private_dns_zones.documents + allowed_subnets_ids = values(data.azurerm_subnet.cosmos_api_allowed)[*].id error_action_group_id = module.monitoring_weu.action_groups.error diff --git a/src/domains/functions/README.md b/src/domains/functions/README.md index 8e9967583..bcdcbf1d9 100644 --- a/src/domains/functions/README.md +++ b/src/domains/functions/README.md @@ -28,28 +28,22 @@ | [function\_assets\_cdn\_autoscale](#module\_function\_assets\_cdn\_autoscale) | github.com/pagopa/dx//infra/modules/azure_app_service_plan_autoscaler | main | | [function\_assets\_cdn\_snet](#module\_function\_assets\_cdn\_snet) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v8.52.0 | | [function\_assets\_cdn\_staging\_slot](#module\_function\_assets\_cdn\_staging\_slot) | git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot | v8.52.0 | -| [function\_public](#module\_function\_public) | git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app | v8.52.0 | -| [function\_public\_staging\_slot](#module\_function\_public\_staging\_slot) | git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot | v8.52.0 | | [function\_services](#module\_function\_services) | git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app | v8.52.0 | | [function\_services\_staging\_slot](#module\_function\_services\_staging\_slot) | git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot | v8.52.0 | | [services\_snet](#module\_services\_snet) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v8.52.0 | -| [shared\_1\_snet](#module\_shared\_1\_snet) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v8.52.0 | | [tests](#module\_tests) | ../../_modules/test_users | n/a | ## Resources | Name | Type | |------|------| -| [azurerm_app_service_plan.shared_1_plan](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service_plan) | resource | | [azurerm_monitor_autoscale_setting.function_admin](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_autoscale_setting) | resource | -| [azurerm_monitor_autoscale_setting.function_public](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_autoscale_setting) | resource | | [azurerm_monitor_autoscale_setting.function_services_autoscale](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_autoscale_setting) | resource | | [azurerm_monitor_metric_alert.function_assets_health_check](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_metric_alert) | resource | | [azurerm_monitor_metric_alert.function_assets_http_server_errors](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_metric_alert) | resource | | [azurerm_monitor_metric_alert.function_assets_response_time](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_metric_alert) | resource | | [azurerm_resource_group.admin_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | | [azurerm_resource_group.services_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | -| [azurerm_resource_group.shared_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | | [azurerm_app_service.appservice_app_backendli](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/app_service) | data source | | [azurerm_application_insights.application_insights](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/application_insights) | data source | | [azurerm_cosmosdb_account.cosmos_api](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/cosmosdb_account) | data source | @@ -104,7 +98,6 @@ | [cidr\_subnet\_fnadmin](#input\_cidr\_subnet\_fnadmin) | Function Admin address space. | `list(string)` | n/a | yes | | [cidr\_subnet\_fncdnassets](#input\_cidr\_subnet\_fncdnassets) | Fn assets address space. | `list(string)` | n/a | yes | | [cidr\_subnet\_services](#input\_cidr\_subnet\_services) | Function services address space. | `list(string)` | n/a | yes | -| [cidr\_subnet\_shared\_1](#input\_cidr\_subnet\_shared\_1) | n/a | `list(string)` | n/a | yes | | [env\_short](#input\_env\_short) | n/a | `string` | n/a | yes | | [function\_admin\_autoscale\_default](#input\_function\_admin\_autoscale\_default) | The number of instances that are available for scaling if metrics are not available for evaluation. | `number` | `1` | no | | [function\_admin\_autoscale\_maximum](#input\_function\_admin\_autoscale\_maximum) | The maximum number of instances for this resource. | `number` | `3` | no | @@ -119,9 +112,6 @@ | [function\_assets\_cdn\_kind](#input\_function\_assets\_cdn\_kind) | App service plan kind | `string` | `null` | no | | [function\_assets\_cdn\_sku\_size](#input\_function\_assets\_cdn\_sku\_size) | App service plan sku size | `string` | `null` | no | | [function\_assets\_cdn\_sku\_tier](#input\_function\_assets\_cdn\_sku\_tier) | App service plan sku tier | `string` | `null` | no | -| [function\_public\_autoscale\_default](#input\_function\_public\_autoscale\_default) | The number of instances that are available for scaling if metrics are not available for evaluation. | `number` | `1` | no | -| [function\_public\_autoscale\_maximum](#input\_function\_public\_autoscale\_maximum) | The maximum number of instances for this resource. | `number` | `3` | no | -| [function\_public\_autoscale\_minimum](#input\_function\_public\_autoscale\_minimum) | The minimum number of instances for this resource. | `number` | `1` | no | | [function\_services\_autoscale\_default](#input\_function\_services\_autoscale\_default) | The number of instances that are available for scaling if metrics are not available for evaluation. | `number` | `1` | no | | [function\_services\_autoscale\_maximum](#input\_function\_services\_autoscale\_maximum) | The maximum number of instances for this resource. | `number` | `30` | no | | [function\_services\_autoscale\_minimum](#input\_function\_services\_autoscale\_minimum) | The minimum number of instances for this resource. | `number` | `1` | no | @@ -134,10 +124,6 @@ | [location\_in](#input\_location\_in) | n/a | `string` | `"italynorth"` | no | | [location\_short](#input\_location\_short) | One of weu, neu | `string` | n/a | yes | | [lock\_enable](#input\_lock\_enable) | Apply locks to block accedentaly deletions. | `bool` | `false` | no | -| [plan\_shared\_1\_kind](#input\_plan\_shared\_1\_kind) | App service plan kind | `string` | `null` | no | -| [plan\_shared\_1\_sku\_capacity](#input\_plan\_shared\_1\_sku\_capacity) | Shared functions app plan capacity | `number` | `1` | no | -| [plan\_shared\_1\_sku\_size](#input\_plan\_shared\_1\_sku\_size) | App service plan sku size | `string` | `null` | no | -| [plan\_shared\_1\_sku\_tier](#input\_plan\_shared\_1\_sku\_tier) | App service plan sku tier | `string` | `null` | no | | [pn\_service\_id](#input\_pn\_service\_id) | The Service ID of PN service | `string` | `"01G40DWQGKY5GRWSNM4303VNRP"` | no | | [prefix](#input\_prefix) | n/a | `string` | `"io"` | no | | [tags](#input\_tags) | n/a | `map(any)` |
{| no |
"CreatedBy": "Terraform"
}