Skip to content

Commit a1f968f

Browse files
feat: [PAYMCLOUD-580] GH runner update@uat (#3645)
* wip * add vnet link private dns zone aks
1 parent 026a281 commit a1f968f

File tree

8 files changed

+34
-4
lines changed

8 files changed

+34
-4
lines changed

src/aks-leonardo/00_network.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ data "azurerm_public_ip" "pip_aks_outboud" {
2929
name = local.public_ip_aks_leonardo_outbound_name
3030
resource_group_name = data.azurerm_resource_group.vnet_ita_rg.name
3131
}
32+
33+
# VNET HUB-SPOKE
34+
data "azurerm_virtual_network" "vnet_hub_spoke" {
35+
for_each = toset(local.hub_spoke_vnet_name)
36+
37+
name = each.key
38+
resource_group_name = local.hub_spoke_vnet_rg_name
39+
}

src/aks-leonardo/03_aks_dns_private_link.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,19 @@ resource "azurerm_private_dns_zone_virtual_network_link" "aks_dns_private_link_v
3838

3939
tags = module.tag_config.tags
4040
}
41+
42+
# Virtual Network Link for Hub - Spoke Network
43+
resource "azurerm_private_dns_zone_virtual_network_link" "aks_dns_private_link_vs_vnet_hub_spoke" {
44+
for_each = var.aks_private_cluster_enabled ? data.azurerm_virtual_network.vnet_hub_spoke : {}
45+
46+
name = each.value.name
47+
virtual_network_id = each.value.id
48+
resource_group_name = module.aks_leonardo.managed_resource_group_name
49+
private_dns_zone_name = module.aks_leonardo.managed_private_dns_zone_name
50+
51+
depends_on = [
52+
module.aks_leonardo,
53+
]
54+
55+
tags = module.tag_config.tags
56+
}

src/aks-leonardo/99_locals.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ locals {
1616

1717
public_ip_aks_leonardo_outbound_name = "pagopa-${var.env_short}-itn-${var.env}-aksoutbound-pip"
1818

19+
hub_spoke_vnet_name = ["${local.product_location}-hub-vnet", "${local.product_location}-spoke-data-vnet", "${local.product_location}-spoke-security-vnet",
20+
"${local.product_location}-spoke-streaming-vnet", "${local.product_location}-spoke-tools-vnet"]
21+
hub_spoke_vnet_rg_name = "${local.product_location}-network-hub-spoke-rg"
22+
1923
# ACR DOCKER
2024
acr_name_ita = replace("${local.product}itncoreacr", "-", "")
2125
acr_resource_group_name_ita = "${local.product}-itn-acr-rg"

src/aks-leonardo/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Re-enable all the resource, commented before to complete the procedure
5757
| [azurerm_linux_virtual_machine.vm_debug_italy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine) | resource |
5858
| [azurerm_network_interface.vm_debug_italy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface) | resource |
5959
| [azurerm_private_dns_zone_virtual_network_link.aks_dns_private_link_vs_vnet_core_weu](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_zone_virtual_network_link) | resource |
60+
| [azurerm_private_dns_zone_virtual_network_link.aks_dns_private_link_vs_vnet_hub_spoke](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_zone_virtual_network_link) | resource |
6061
| [azurerm_private_dns_zone_virtual_network_link.aks_dns_private_link_vs_vnet_ita](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_zone_virtual_network_link) | resource |
6162
| [azurerm_resource_group.rg_aks](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
6263
| [azurerm_role_assignment.aks_to_acr](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) | resource |
@@ -102,6 +103,7 @@ Re-enable all the resource, commented before to complete the procedure
102103
| [azurerm_resource_group.vnet_ita_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
103104
| [azurerm_subscription.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription) | data source |
104105
| [azurerm_virtual_network.vnet_core](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source |
106+
| [azurerm_virtual_network.vnet_hub_spoke](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source |
105107
| [azurerm_virtual_network.vnet_ita](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source |
106108

107109
## Inputs

src/domains/cruscotto-app/07_gh_runner.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
tools_cae_name = var.env_short == "d" ? "${local.product}-${var.location_short}-core-spoke-tools-cae" : "${local.product}-${var.location_short}-core-tools-cae"
2+
tools_cae_name = var.env_short != "p" ? "${local.project_core_itn}-spoke-tools-cae" : "${local.product}-${var.location_short}-core-tools-cae"
33
tools_cae_rg = "${local.product}-${var.location_short}-core-tools-rg"
44
}
55

src/domains/ebollo-app/07_gh_runner.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
tools_cae_name = var.env_short == "d" ? "${local.product}-${var.location_short}-core-spoke-tools-cae" : "${local.product}-${var.location_short}-core-tools-cae"
2+
tools_cae_name = var.env_short != "p" ? "${local.project_core_itn}-spoke-tools-cae" : "${local.product}-${var.location_short}-core-tools-cae"
33
tools_cae_rg = "${local.product}-${var.location_short}-core-tools-rg"
44
}
55

src/domains/payopt-app/07_gh_runner.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
tools_cae_name = var.env_short == "d" ? "${local.product}-${var.location_short}-core-spoke-tools-cae" : "${local.product}-${var.location_short}-core-tools-cae"
2+
tools_cae_name = var.env_short != "p" ? "${local.project_core_itn}-spoke-tools-cae" : "${local.product}-${var.location_short}-core-tools-cae"
33
tools_cae_rg = "${local.product}-${var.location_short}-core-tools-rg"
44
}
55

src/domains/printit-app/07_gh_runner.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
tools_cae_name = var.env_short == "d" ? "${local.product}-${var.location_short}-core-spoke-tools-cae" : "${local.product}-${var.location_short}-core-tools-cae"
2+
tools_cae_name = var.env_short != "p" ? "${local.project_core_itn}-spoke-tools-cae" : "${local.product}-${var.location_short}-core-tools-cae"
33
tools_cae_rg = "${local.product}-${var.location_short}-core-tools-rg"
44
}
55

0 commit comments

Comments
 (0)