Skip to content

Commit

Permalink
Merge branch 'main' into IOPID-2513
Browse files Browse the repository at this point in the history
  • Loading branch information
giamma1295 authored Jan 14, 2025
2 parents ca12463 + d6fc5da commit b7238bb
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 29 deletions.
14 changes: 7 additions & 7 deletions src/core/_modules/networking/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
output "vnet_common" {
value = {
id = module.vnet_common.id
name = module.vnet_common.name
address_space = module.vnet_common.address_space
resource_group_name = module.vnet_common.resource_group_name
id = azurerm_virtual_network.common.id
name = azurerm_virtual_network.common.name
address_space = azurerm_virtual_network.common.address_space
resource_group_name = azurerm_virtual_network.common.resource_group_name
}
}

output "pep_snet" {
value = {
id = module.pep_snet.id
name = module.pep_snet.name
address_prefixes = module.pep_snet.address_prefixes
id = azurerm_subnet.pep.id
name = azurerm_subnet.pep.name
address_prefixes = azurerm_subnet.pep.address_prefixes
}
}

Expand Down
7 changes: 2 additions & 5 deletions src/core/_modules/networking/snet_private_endpoints.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
module "pep_snet" {
source = "github.com/pagopa/terraform-azurerm-v3//subnet?ref=v8.27.0"
resource "azurerm_subnet" "pep" {
name = try(local.nonstandard[var.location_short].pep-snet, "${var.project}-pep-snet-01")
address_prefixes = var.pep_snet_cidr
virtual_network_name = azurerm_virtual_network.common.name
resource_group_name = var.resource_group_name
virtual_network_name = module.vnet_common.name

private_endpoint_network_policies_enabled = false
}
13 changes: 7 additions & 6 deletions src/core/_modules/networking/vnet_common.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module "vnet_common" {
source = "github.com/pagopa/terraform-azurerm-v3//virtual_network?ref=v8.27.0"

resource "azurerm_virtual_network" "common" {
name = try(local.nonstandard[var.location_short].vnet, "${var.project}-common-vnet-01")
location = var.location
resource_group_name = var.resource_group_name
location = var.location
address_space = [var.vnet_cidr_block]

address_space = [var.vnet_cidr_block]
ddos_protection_plan = local.ddos_protection_plan
ddos_protection_plan {
id = local.ddos_protection_plan.id
enable = local.ddos_protection_plan.enable
}

tags = var.tags
}
17 changes: 6 additions & 11 deletions src/core/_modules/vpn/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
## VPN

module "vpn_snet" {
source = "github.com/pagopa/terraform-azurerm-v3//subnet?ref=v8.33.1"
name = "GatewaySubnet"
address_prefixes = var.vpn_cidr_subnet
resource_group_name = var.resource_group_name
virtual_network_name = var.vnet_common.name
service_endpoints = []
private_endpoint_network_policies_enabled = false
resource "azurerm_subnet" "vpn" {
name = "GatewaySubnet"
address_prefixes = var.vpn_cidr_subnet
virtual_network_name = var.vnet_common.name
resource_group_name = var.resource_group_name
}

module "vpn" {
Expand All @@ -18,7 +13,7 @@ module "vpn" {
resource_group_name = var.resource_group_name
sku = var.vpn_sku
pip_sku = var.vpn_pip_sku
subnet_id = module.vpn_snet.id
subnet_id = azurerm_subnet.vpn.id

vpn_client_configuration = [
{
Expand Down
30 changes: 30 additions & 0 deletions src/core/prod/moved.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
moved {
from = module.vpn_weu.module.vpn_snet.azurerm_subnet.this
to = module.vpn_weu.azurerm_subnet.vpn
}

moved {
from = module.vpn_weu.module.vpn_snet.azurerm_subnet.this
to = module.vpn_weu.azurerm_subnet.vpn
}

moved {
from = module.networking_itn.module.pep_snet.azurerm_subnet.this
to = module.networking_itn.azurerm_subnet.pep
}

moved {
from = module.networking_weu.module.pep_snet.azurerm_subnet.this
to = module.networking_weu.azurerm_subnet.pep
}

moved {
from = module.networking_weu.module.vnet_common.azurerm_virtual_network.this
to = module.networking_weu.azurerm_virtual_network.common
}

moved {
from = module.networking_itn.module.vnet_common.azurerm_virtual_network.this
to = module.networking_itn.azurerm_virtual_network.common
}

0 comments on commit b7238bb

Please sign in to comment.