diff --git a/src/core/.terraform.lock.hcl b/src/core/.terraform.lock.hcl index 24f6680d0..c22ce9583 100644 --- a/src/core/.terraform.lock.hcl +++ b/src/core/.terraform.lock.hcl @@ -49,7 +49,7 @@ provider "registry.terraform.io/hashicorp/azuread" { provider "registry.terraform.io/hashicorp/azurerm" { version = "3.110.0" - constraints = "~> 3.30, ~> 3.33, ~> 3.76, ~> 3.95, != 3.97.0, != 3.97.1, <= 3.110.0" + constraints = "~> 3.30, ~> 3.76, ~> 3.95, != 3.97.0, != 3.97.1, <= 3.110.0" hashes = [ "h1:4QrrAcbVTUzX2xQIywvAZeM+lrCgcFbFGoADvTAXdhk=", "h1:EY+IRabj+4NJ3tqB4kVg7dTjoTdwOMHUhIvIoddgRTI=", @@ -95,7 +95,7 @@ provider "registry.terraform.io/hashicorp/local" { provider "registry.terraform.io/hashicorp/null" { version = "3.2.1" - constraints = "~> 3.2, <= 3.2.1" + constraints = "<= 3.2.1" hashes = [ "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", "h1:tSj1mL6OQ8ILGqR2mDu7OYYYWf+hoir0pf9KAQ8IzO8=", @@ -141,7 +141,7 @@ provider "registry.terraform.io/hashicorp/random" { provider "registry.terraform.io/hashicorp/tls" { version = "4.0.4" - constraints = "~> 4.0, <= 4.0.4" + constraints = "<= 4.0.4" hashes = [ "h1:GZcFizg5ZT2VrpwvxGBHQ/hO9r6g0vYdQqx3bFD3anY=", "h1:Wd3RqmQW60k2QWPN4sK5CtjGuO1d+CRNXgC+D4rKtXc=", diff --git a/src/core/README.md b/src/core/README.md index 92d273884..76819ca6e 100644 --- a/src/core/README.md +++ b/src/core/README.md @@ -45,9 +45,6 @@ | [appservice\_app\_backendli](#module\_appservice\_app\_backendli) | github.com/pagopa/terraform-azurerm-v3//app_service | v8.31.0 | | [appservice\_app\_backendli\_slot\_staging](#module\_appservice\_app\_backendli\_slot\_staging) | github.com/pagopa/terraform-azurerm-v3//app_service_slot | v8.31.0 | | [assets\_cdn](#module\_assets\_cdn) | github.com/pagopa/terraform-azurerm-v3//storage_account | v8.27.0 | -| [azdoa\_li\_infra](#module\_azdoa\_li\_infra) | github.com/pagopa/terraform-azurerm-v3//azure_devops_agent | v8.27.0 | -| [azdoa\_loadtest\_li](#module\_azdoa\_loadtest\_li) | github.com/pagopa/terraform-azurerm-v3//azure_devops_agent | v8.27.0 | -| [azdoa\_snet](#module\_azdoa\_snet) | github.com/pagopa/terraform-azurerm-v3//subnet | v8.27.0 | | [locked\_profiles\_storage](#module\_locked\_profiles\_storage) | github.com/pagopa/terraform-azurerm-v3//storage_account | v8.27.0 | | [redis\_common\_backup\_zrs](#module\_redis\_common\_backup\_zrs) | github.com/pagopa/terraform-azurerm-v3//storage_account | v8.27.0 | | [redis\_common\_snet](#module\_redis\_common\_snet) | github.com/pagopa/terraform-azurerm-v3//subnet | v8.27.0 | @@ -103,7 +100,6 @@ | [azurerm_monitor_metric_alert.too_many_http_5xx](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_metric_alert) | resource | | [azurerm_private_endpoint.locked_profiles_storage_table](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource | | [azurerm_resource_group.assets_cdn_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | -| [azurerm_resource_group.azdo_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | | [azurerm_resource_group.data](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | | [azurerm_resource_group.default_roleassignment_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | | [azurerm_resource_group.grafana_dashboard_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | @@ -216,6 +212,7 @@ | [azurerm_subnet.admin_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.apim](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_subnet.appgateway_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_let_snet](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.functions_service_messages_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | diff --git a/src/core/_modules/azure_devops_agent/locals.tf b/src/core/_modules/azure_devops_agent/locals.tf new file mode 100644 index 000000000..b0b41bb02 --- /dev/null +++ b/src/core/_modules/azure_devops_agent/locals.tf @@ -0,0 +1,12 @@ +locals { + nonstandard = { + weu = { + rg = "${var.project}-azdoa-rg" + snet = "azure-devops" + li_infra = "${var.project}-azdoa-vmss-li-infra" + li_loadtest = "${var.project}-azdoa-vmss-loadtest-li" + } + } + + image_name = "azdo-agent-ubuntu2204-image-v2" +} \ No newline at end of file diff --git a/src/core/_modules/azure_devops_agent/main.tf b/src/core/_modules/azure_devops_agent/main.tf new file mode 100644 index 000000000..aa965f729 --- /dev/null +++ b/src/core/_modules/azure_devops_agent/main.tf @@ -0,0 +1,46 @@ +resource "azurerm_resource_group" "azdoa_rg" { + name = try(local.nonstandard[var.location_short].rg, "${var.project}-azdoa-rg-01") + location = var.location + + tags = var.tags +} + +module "azdoa_snet" { + source = "github.com/pagopa/terraform-azurerm-v3//subnet?ref=v8.27.0" + + name = try(local.nonstandard[var.location_short].snet, "${var.project}-azdoa-snet-01") + address_prefixes = var.cidr_subnet + resource_group_name = var.resource_groups.common + virtual_network_name = var.vnet_common.name + private_endpoint_network_policies_enabled = false + + service_endpoints = [ + "Microsoft.Web", + ] +} + +module "azdoa_li_infra" { + source = "github.com/pagopa/terraform-azurerm-v3//azure_devops_agent?ref=v8.27.0" + name = try(local.nonstandard[var.location_short].li_infra, "${var.project}-azdoa-infra-vmss-01") + resource_group_name = azurerm_resource_group.azdoa_rg.name + subnet_id = module.azdoa_snet.id + subscription_id = var.datasources.azurerm_client_config.subscription_id + location = var.location + source_image_name = local.image_name + vm_sku = "Standard_B2als_v2" + + tags = var.tags +} + +module "azdoa_loadtest_li" { + source = "github.com/pagopa/terraform-azurerm-v3//azure_devops_agent?ref=v8.27.0" + name = try(local.nonstandard[var.location_short].li_loadtest, "${var.project}-azdoa-loadtest-vmss-01") + resource_group_name = azurerm_resource_group.azdoa_rg.name + subnet_id = module.azdoa_snet.id + subscription_id = var.datasources.azurerm_client_config.subscription_id + location = var.location + source_image_name = local.image_name + vm_sku = "Standard_D8ds_v5" + + tags = var.tags +} diff --git a/src/core/_modules/azure_devops_agent/outputs.tf b/src/core/_modules/azure_devops_agent/outputs.tf new file mode 100644 index 000000000..6036d86d1 --- /dev/null +++ b/src/core/_modules/azure_devops_agent/outputs.tf @@ -0,0 +1,7 @@ +output "snet" { + value = { + id = module.azdoa_snet.id + name = module.azdoa_snet.name + address_prefixes = module.azdoa_snet.address_prefixes + } +} \ No newline at end of file diff --git a/src/core/_modules/azure_devops_agent/variables.tf b/src/core/_modules/azure_devops_agent/variables.tf new file mode 100644 index 000000000..b4a8d5f83 --- /dev/null +++ b/src/core/_modules/azure_devops_agent/variables.tf @@ -0,0 +1,49 @@ +variable "project" { + type = string + description = "IO prefix, short environment and short location" +} + +variable "location" { + type = string + description = "Azure region" +} + +variable "location_short" { + type = string + description = "Azure region short name" +} + +variable "tags" { + type = map(any) + description = "Resource tags" +} + +variable "resource_group_name" { + type = string + description = "Resource group name for VNet" +} + +variable "cidr_subnet" { + type = list(string) + description = "Azure DevOps agent network address space" +} + +variable "vnet_common" { + type = object({ + id = string + name = string + address_space = list(string) + resource_group_name = string + }) + description = "Information of the common VNet" +} + +variable "resource_groups" { + type = map(string) + description = "Resource group names" +} + +variable "datasources" { + type = map(any) + description = "Common datasources" +} \ No newline at end of file diff --git a/src/core/app_backend.tf b/src/core/app_backend.tf index 50e587915..47d81495b 100644 --- a/src/core/app_backend.tf +++ b/src/core/app_backend.tf @@ -717,7 +717,7 @@ module "appservice_app_backendl1_slot_staging" { ip_restriction_default_action = "Deny" allowed_subnets = [ - module.azdoa_snet[0].id, + data.azurerm_subnet.azdoa_snet.id, data.azurerm_subnet.services_snet[0].id, data.azurerm_subnet.services_snet[1].id, data.azurerm_subnet.appgateway_snet.id, @@ -847,7 +847,7 @@ module "appservice_app_backendl2_slot_staging" { ip_restriction_default_action = "Deny" allowed_subnets = [ - module.azdoa_snet[0].id, + data.azurerm_subnet.azdoa_snet.id, data.azurerm_subnet.services_snet[0].id, data.azurerm_subnet.services_snet[1].id, data.azurerm_subnet.appgateway_snet.id, @@ -964,7 +964,7 @@ module "appservice_app_backendli_slot_staging" { ip_restriction_default_action = "Deny" allowed_subnets = [ - module.azdoa_snet[0].id, + data.azurerm_subnet.azdoa_snet.id, data.azurerm_subnet.services_snet[0].id, data.azurerm_subnet.services_snet[1].id, data.azurerm_subnet.admin_snet.id, diff --git a/src/core/azure_devops_agent.tf b/src/core/azure_devops_agent.tf deleted file mode 100644 index 646a962d7..000000000 --- a/src/core/azure_devops_agent.tf +++ /dev/null @@ -1,50 +0,0 @@ -resource "azurerm_resource_group" "azdo_rg" { - count = var.enable_azdoa ? 1 : 0 - name = format("%s-azdoa-rg", local.project) - location = var.location - - tags = var.tags -} - -module "azdoa_snet" { - count = var.enable_azdoa ? 1 : 0 - source = "github.com/pagopa/terraform-azurerm-v3//subnet?ref=v8.27.0" - - name = "azure-devops" - address_prefixes = var.cidr_subnet_azdoa - resource_group_name = azurerm_resource_group.rg_common.name - virtual_network_name = data.azurerm_virtual_network.common.name - private_endpoint_network_policies_enabled = false - - service_endpoints = [ - "Microsoft.Web", - ] -} - -module "azdoa_li_infra" { - source = "github.com/pagopa/terraform-azurerm-v3//azure_devops_agent?ref=v8.27.0" - count = var.enable_azdoa ? 1 : 0 - name = "${local.project}-azdoa-vmss-li-infra" - resource_group_name = azurerm_resource_group.azdo_rg[0].name - subnet_id = module.azdoa_snet[0].id - subscription_id = data.azurerm_subscription.current.subscription_id - location = var.location - source_image_name = var.azdoa_image_name - vm_sku = "Standard_B2als_v2" - - tags = var.tags -} - -module "azdoa_loadtest_li" { - source = "github.com/pagopa/terraform-azurerm-v3//azure_devops_agent?ref=v8.27.0" - count = var.enable_azdoa ? 1 : 0 - name = format("%s-azdoa-vmss-loadtest-li", local.project) - resource_group_name = azurerm_resource_group.azdo_rg[0].name - subnet_id = module.azdoa_snet[0].id - subscription_id = data.azurerm_subscription.current.subscription_id - location = var.location - source_image_name = var.azdoa_image_name - vm_sku = "Standard_D8ds_v5" - - tags = var.tags -} diff --git a/src/core/data.tf b/src/core/data.tf index 55558114e..b63b193fa 100644 --- a/src/core/data.tf +++ b/src/core/data.tf @@ -462,3 +462,13 @@ data "azurerm_subnet" "appgateway_snet" { resource_group_name = azurerm_resource_group.rg_common.name virtual_network_name = data.azurerm_virtual_network.common.name } + +# +# Azure DevOps Agent +# + +data "azurerm_subnet" "azdoa_snet" { + name = "azure-devops" + resource_group_name = azurerm_resource_group.rg_common.name + virtual_network_name = data.azurerm_virtual_network.common.name +} \ No newline at end of file diff --git a/src/core/prod/.terraform.lock.hcl b/src/core/prod/.terraform.lock.hcl index 98d5d78c0..a2c505b48 100644 --- a/src/core/prod/.terraform.lock.hcl +++ b/src/core/prod/.terraform.lock.hcl @@ -47,69 +47,93 @@ provider "registry.terraform.io/hashicorp/azurerm" { } provider "registry.terraform.io/hashicorp/local" { - version = "2.5.1" + version = "2.5.2" constraints = "~> 2.3" hashes = [ - "h1:/GAVA/xheGQcbOZEq0qxANOg+KVLCA7Wv8qluxhTjhU=", - "h1:8oTPe2VUL6E2d3OcrvqyjI4Nn/Y/UEQN26WLk5O/B0g=", - "h1:Np4kERf9SMrqUi7DJ1rK3soMK14k49nfgE7l/ipQ5xw=", - "h1:tjcGlQAFA0kmQ4vKkIPPUC4it1UYxLbg4YvHOWRAJHA=", - "zh:0af29ce2b7b5712319bf6424cb58d13b852bf9a777011a545fac99c7fdcdf561", - "zh:126063ea0d79dad1f68fa4e4d556793c0108ce278034f101d1dbbb2463924561", - "zh:196bfb49086f22fd4db46033e01655b0e5e036a5582d250412cc690fa7995de5", - "zh:37c92ec084d059d37d6cffdb683ccf68e3a5f8d2eb69dd73c8e43ad003ef8d24", - "zh:4269f01a98513651ad66763c16b268f4c2da76cc892ccfd54b401fff6cc11667", - "zh:51904350b9c728f963eef0c28f1d43e73d010333133eb7f30999a8fb6a0cc3d8", - "zh:73a66611359b83d0c3fcba2984610273f7954002febb8a57242bbb86d967b635", + "h1:6NIiHWMbE9bFZaUiqC+OokdWSbW7g3+yQYnO4yvgtuY=", + "h1:IyFbOIO6mhikFNL/2h1iZJ6kyN3U00jgkpCLUCThAfE=", + "h1:JlMZD6nYqJ8sSrFfEAH0Vk/SL8WLZRmFaMUF9PJK5wM=", + "h1:p99F1AoV9z51aJ4EdItxz/vLwWIyhx/0Iw7L7sWSH1o=", + "zh:136299545178ce281c56f36965bf91c35407c11897f7082b3b983d86cb79b511", + "zh:3b4486858aa9cb8163378722b642c57c529b6c64bfbfc9461d940a84cd66ebea", + "zh:4855ee628ead847741aa4f4fc9bed50cfdbf197f2912775dd9fe7bc43fa077c0", + "zh:4b8cd2583d1edcac4011caafe8afb7a95e8110a607a1d5fb87d921178074a69b", + "zh:52084ddaff8c8cd3f9e7bcb7ce4dc1eab00602912c96da43c29b4762dc376038", + "zh:71562d330d3f92d79b2952ffdda0dad167e952e46200c767dd30c6af8d7c0ed3", "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7ae387993a92bcc379063229b3cce8af7eaf082dd9306598fcd42352994d2de0", - "zh:9e0f365f807b088646db6e4a8d4b188129d9ebdbcf2568c8ab33bddd1b82c867", - "zh:b5263acbd8ae51c9cbffa79743fbcadcb7908057c87eb22fd9048268056efbc4", - "zh:dfcd88ac5f13c0d04e24be00b686d069b4879cc4add1b7b1a8ae545783d97520", + "zh:805f81ade06ff68fa8b908d31892eaed5c180ae031c77ad35f82cb7a74b97cf4", + "zh:8b6b3ebeaaa8e38dd04e56996abe80db9be6f4c1df75ac3cccc77642899bd464", + "zh:ad07750576b99248037b897de71113cc19b1a8d0bc235eb99173cc83d0de3b1b", + "zh:b9f1c3bfadb74068f5c205292badb0661e17ac05eb23bfe8bd809691e4583d0e", + "zh:cc4cbcd67414fefb111c1bf7ab0bc4beb8c0b553d01719ad17de9a047adff4d1", ] } provider "registry.terraform.io/hashicorp/null" { - version = "3.2.2" + version = "3.2.3" + constraints = "~> 3.2" hashes = [ - "h1:IMVAUHKoydFrlPrl9OzasDnw/8ntZFerCC9iXw1rXQY=", - "h1:m467k2tZ9cdFFgHW7LPBK2GLPH43LC6wc3ppxr8yvoE=", - "h1:vWAsYRd7MjYr3adj8BVKRohVfHpWQdvkIwUQ2Jf5FVM=", - "h1:zT1ZbegaAYHwQa+QwIFugArWikRJI9dqohj8xb0GY88=", - "zh:3248aae6a2198f3ec8394218d05bd5e42be59f43a3a7c0b71c66ec0df08b69e7", - "zh:32b1aaa1c3013d33c245493f4a65465eab9436b454d250102729321a44c8ab9a", - "zh:38eff7e470acb48f66380a73a5c7cdd76cc9b9c9ba9a7249c7991488abe22fe3", - "zh:4c2f1faee67af104f5f9e711c4574ff4d298afaa8a420680b0cb55d7bbc65606", - "zh:544b33b757c0b954dbb87db83a5ad921edd61f02f1dc86c6186a5ea86465b546", - "zh:696cf785090e1e8cf1587499516b0494f47413b43cb99877ad97f5d0de3dc539", - "zh:6e301f34757b5d265ae44467d95306d61bef5e41930be1365f5a8dcf80f59452", + "h1:+AnORRgFbRO6qqcfaQyeX80W0eX3VmjadjnUFUJTiXo=", + "h1:I0Um8UkrMUb81Fxq/dxbr3HLP2cecTH2WMJiwKSrwQY=", + "h1:nKUqWEza6Lcv3xRlzeiRQrHtqvzX1BhIzjaOVXRYQXQ=", + "h1:zxoDtu918XPWJ/Y6s4aFrZydn6SfqkRc5Ax1ZLnC6Ew=", + "zh:22d062e5278d872fe7aed834f5577ba0a5afe34a3bdac2b81f828d8d3e6706d2", + "zh:23dead00493ad863729495dc212fd6c29b8293e707b055ce5ba21ee453ce552d", + "zh:28299accf21763ca1ca144d8f660688d7c2ad0b105b7202554ca60b02a3856d3", + "zh:55c9e8a9ac25a7652df8c51a8a9a422bd67d784061b1de2dc9fe6c3cb4e77f2f", + "zh:756586535d11698a216291c06b9ed8a5cc6a4ec43eee1ee09ecd5c6a9e297ac1", "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:913a929070c819e59e94bb37a2a253c228f83921136ff4a7aa1a178c7cce5422", - "zh:aa9015926cd152425dbf86d1abdbc74bfe0e1ba3d26b3db35051d7b9ca9f72ae", - "zh:bb04798b016e1e1d49bcc76d62c53b56c88c63d6f2dfe38821afef17c416a0e1", - "zh:c23084e1b23577de22603cff752e59128d83cfecc2e6819edadd8cf7a10af11e", + "zh:9d5eea62fdb587eeb96a8c4d782459f4e6b73baeece4d04b4a40e44faaee9301", + "zh:a6355f596a3fb8fc85c2fb054ab14e722991533f87f928e7169a486462c74670", + "zh:b5a65a789cff4ada58a5baffc76cb9767dc26ec6b45c00d2ec8b1b027f6db4ed", + "zh:db5ab669cf11d0e9f81dc380a6fdfcac437aea3d69109c7aef1a5426639d2d65", + "zh:de655d251c470197bcbb5ac45d289595295acb8f829f6c781d4a75c8c8b7c7dd", + "zh:f5c68199f2e6076bce92a12230434782bf768103a427e9bb9abee99b116af7b5", ] } provider "registry.terraform.io/hashicorp/random" { - version = "3.6.2" + version = "3.6.3" constraints = "~> 3.4" hashes = [ - "h1:5lstwe/L8AZS/CP0lil2nPvmbbjAu8kCaU/ogSGNbxk=", - "h1:R5qdQjKzOU16TziCN1vR3Exr/B+8WGK80glLTT4ZCPk=", - "h1:VavG5unYCa3SYISMKF9pzc3718M0bhPlcbUZZGl7wuo=", - "h1:wmG0QFjQ2OfyPy6BB7mQ57WtoZZGGV07uAPQeDmIrAE=", - "zh:0ef01a4f81147b32c1bea3429974d4d104bbc4be2ba3cfa667031a8183ef88ec", - "zh:1bcd2d8161e89e39886119965ef0f37fcce2da9c1aca34263dd3002ba05fcb53", - "zh:37c75d15e9514556a5f4ed02e1548aaa95c0ecd6ff9af1119ac905144c70c114", - "zh:4210550a767226976bc7e57d988b9ce48f4411fa8a60cd74a6b246baf7589dad", - "zh:562007382520cd4baa7320f35e1370ffe84e46ed4e2071fdc7e4b1a9b1f8ae9b", - "zh:5efb9da90f665e43f22c2e13e0ce48e86cae2d960aaf1abf721b497f32025916", - "zh:6f71257a6b1218d02a573fc9bff0657410404fb2ef23bc66ae8cd968f98d5ff6", + "h1:+UItZOLue/moJfnI3tqZBQbXUYR4ZnqPYfJDJPgLZy0=", + "h1:Fnaec9vA8sZ8BXVlN3Xn9Jz3zghSETIKg7ch8oXhxno=", + "h1:f6jXn4MCv67kgcofx9D49qx1ZEBv8oyvwKDMPBr0A24=", + "h1:zG9uFP8l9u+yGZZvi5Te7PV62j50azpgwPunq2vTm1E=", + "zh:04ceb65210251339f07cd4611885d242cd4d0c7306e86dda9785396807c00451", + "zh:448f56199f3e99ff75d5c0afacae867ee795e4dfda6cb5f8e3b2a72ec3583dd8", + "zh:4b4c11ccfba7319e901df2dac836b1ae8f12185e37249e8d870ee10bb87a13fe", + "zh:4fa45c44c0de582c2edb8a2e054f55124520c16a39b2dfc0355929063b6395b1", + "zh:588508280501a06259e023b0695f6a18149a3816d259655c424d068982cbdd36", + "zh:737c4d99a87d2a4d1ac0a54a73d2cb62974ccb2edbd234f333abd079a32ebc9e", "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:9647e18f221380a85f2f0ab387c68fdafd58af6193a932417299cdcae4710150", - "zh:bb6297ce412c3c2fa9fec726114e5e0508dd2638cad6a0cb433194930c97a544", - "zh:f83e925ed73ff8a5ef6e3608ad9225baa5376446349572c2449c0c0b3cf184b7", - "zh:fbef0781cb64de76b1df1ca11078aecba7800d82fd4a956302734999cfd9a4af", + "zh:a357ab512e5ebc6d1fda1382503109766e21bbfdfaa9ccda43d313c122069b30", + "zh:c51bfb15e7d52cc1a2eaec2a903ac2aff15d162c172b1b4c17675190e8147615", + "zh:e0951ee6fa9df90433728b96381fb867e3db98f66f735e0c3e24f8f16903f0ad", + "zh:e3cdcb4e73740621dabd82ee6a37d6cfce7fee2a03d8074df65086760f5cf556", + "zh:eff58323099f1bd9a0bec7cb04f717e7f1b2774c7d612bf7581797e1622613a0", + ] +} + +provider "registry.terraform.io/hashicorp/tls" { + version = "4.0.6" + constraints = "~> 4.0" + hashes = [ + "h1:/sSdjHoiykrPdyBP1JE03V/KDgLXnHZhHcSOYIdDH/A=", + "h1:17Y+vdYNKgphpe1/SU5PBnGuYKEJkJZ7MZCnmAwsAGQ=", + "h1:dYSb3V94K5dDMtrBRLPzBpkMTPn+3cXZ/kIJdtFL+2M=", + "h1:n3M50qfWfRSpQV9Pwcvuse03pEizqrmYEryxKky4so4=", + "zh:10de0d8af02f2e578101688fd334da3849f56ea91b0d9bd5b1f7a243417fdda8", + "zh:37fc01f8b2bc9d5b055dc3e78bfd1beb7c42cfb776a4c81106e19c8911366297", + "zh:4578ca03d1dd0b7f572d96bd03f744be24c726bfd282173d54b100fd221608bb", + "zh:6c475491d1250050765a91a493ef330adc24689e8837a0f07da5a0e1269e11c1", + "zh:81bde94d53cdababa5b376bbc6947668be4c45ab655de7aa2e8e4736dfd52509", + "zh:abdce260840b7b050c4e401d4f75c7a199fafe58a8b213947a258f75ac18b3e8", + "zh:b754cebfc5184873840f16a642a7c9ef78c34dc246a8ae29e056c79939963c7a", + "zh:c928b66086078f9917aef0eec15982f2e337914c5c4dbc31dd4741403db7eb18", + "zh:cded27bee5f24de6f2ee0cfd1df46a7f88e84aaffc2ecbf3ff7094160f193d50", + "zh:d65eb3867e8f69aaf1b8bb53bd637c99c6b649ba3db16ded50fa9a01076d1a27", + "zh:ecb0c8b528c7a619fa71852bb3fb5c151d47576c5aab2bf3af4db52588722eeb", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", ] } diff --git a/src/core/prod/README.md b/src/core/prod/README.md index ab8256be5..16539a539 100644 --- a/src/core/prod/README.md +++ b/src/core/prod/README.md @@ -10,6 +10,7 @@ | Name | Source | Version | |------|--------|---------| +| [azdoa\_weu](#module\_azdoa\_weu) | ../_modules/azure_devops_agent | n/a | | [container\_registry](#module\_container\_registry) | ../_modules/container_registry | n/a | | [key\_vault\_weu](#module\_key\_vault\_weu) | ../_modules/key_vaults | n/a | | [networking\_itn](#module\_networking\_itn) | ../_modules/networking | n/a | diff --git a/src/core/prod/locals.tf b/src/core/prod/locals.tf index 91ccbf5af..1662a4a10 100644 --- a/src/core/prod/locals.tf +++ b/src/core/prod/locals.tf @@ -14,4 +14,23 @@ locals { Owner = "IO" Source = "https://github.com/pagopa/io-infra/blob/main/src/core/prod" } + + # TODO: edit this block when resource groups module is implemented + resource_groups = { + weu = { + common = "${local.project_weu_legacy}-rg-common" + internal = "${local.project_weu_legacy}-rg-internal" + external = "${local.project_weu_legacy}-rg-external" + event = "${local.project_weu_legacy}-evt-rg" + sec = "${local.project_weu_legacy}-sec-rg" + } + + itn = { + common = "${local.project_itn}-common-rg-01" + internal = "${local.project_itn}-common-rg-01" + external = "${local.project_itn}-common-rg-01" + event = "${local.project_itn}-common-rg-01" + sec = "${local.project_itn}-sec-rg-01" + } + } } diff --git a/src/core/prod/westeurope.tf b/src/core/prod/westeurope.tf index ed3d74085..ead5d6fea 100644 --- a/src/core/prod/westeurope.tf +++ b/src/core/prod/westeurope.tf @@ -108,3 +108,22 @@ module "vpn_weu" { tags = local.tags } + +module "azdoa_weu" { + source = "../_modules/azure_devops_agent" + + location = data.azurerm_resource_group.common_weu.location + location_short = local.location_short[data.azurerm_resource_group.common_weu.location] + resource_group_name = data.azurerm_resource_group.common_weu.name + project = local.project_weu_legacy + + vnet_common = module.networking_weu.vnet_common + resource_groups = local.resource_groups[local.location_short[data.azurerm_resource_group.common_weu.location]] + datasources = { + azurerm_client_config = data.azurerm_client_config.current + } + + cidr_subnet = ["10.0.250.0/24"] + + tags = local.tags +} \ No newline at end of file