diff --git a/infra/resources/prod/README.md b/infra/resources/prod/README.md new file mode 100644 index 00000000..21b7d025 --- /dev/null +++ b/infra/resources/prod/README.md @@ -0,0 +1,38 @@ +# prod + + +## Requirements + +| Name | Version | +|------|---------| +| [azurerm](#requirement\_azurerm) | <= 4.2.0 | + +## Providers + +| Name | Version | +|------|---------| +| [azurerm](#provider\_azurerm) | 3.116.0 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [apim\_itn](#module\_apim\_itn) | ../_modules/apim | n/a | +| [apim\_weu](#module\_apim\_weu) | ../_modules/apim | n/a | + +## Resources + +| Name | Type | +|------|------| +| [azurerm_api_management.apim](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/api_management) | data source | +| [azurerm_api_management.apim_itn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/api_management) | data source | +| [azurerm_key_vault.common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault) | data source | + +## Inputs + +No inputs. + +## Outputs + +No outputs. + diff --git a/infra/resources/prod/data.tf b/infra/resources/prod/data.tf index dfadd14a..b2367083 100644 --- a/infra/resources/prod/data.tf +++ b/infra/resources/prod/data.tf @@ -3,6 +3,11 @@ data "azurerm_api_management" "apim" { resource_group_name = "${local.project_legacy}-rg-internal" } +data "azurerm_api_management" "apim_itn" { + name = local.apim_itn.name + resource_group_name = local.apim_itn.resource_group_name +} + data "azurerm_key_vault" "common" { name = "${local.project_legacy}-kv-common" resource_group_name = "${local.project_legacy}-rg-common" diff --git a/infra/resources/prod/italynorth.tf b/infra/resources/prod/italynorth.tf new file mode 100644 index 00000000..550b3afc --- /dev/null +++ b/infra/resources/prod/italynorth.tf @@ -0,0 +1,9 @@ + +module "apim_itn" { + source = "../_modules/apim" + + apim_name = data.azurerm_api_management.apim_itn.name + apim_resource_group_name = data.azurerm_api_management.apim_itn.resource_group_name + + key_vault_common_id = data.azurerm_key_vault.common.id +} diff --git a/infra/resources/prod/locals.tf b/infra/resources/prod/locals.tf index 0010e7e1..df570285 100644 --- a/infra/resources/prod/locals.tf +++ b/infra/resources/prod/locals.tf @@ -18,4 +18,14 @@ locals { ManagementTeam = "IO Platform" Source = "https://github.com/pagopa/io-functions-admin/blob/main/infra/resources/prod" } + + # ITN + location_itn = "italynorth" + location_short_itn = "itn" + project_itn = "${local.prefix}-${local.env_short}-${local.location_short_itn}" + + apim_itn = { + name = "${local.project_itn}-apim-01" + resource_group_name = "${local.project_itn}-common-rg-01" + } }