Skip to content

Commit

Permalink
chore: [PAGOPA-2505] fix private endpoint storage account WISP (#2684)
Browse files Browse the repository at this point in the history
* improvements

* Revert "improvements"

This reverts commit 367d041.

* fix storage account private endpoints
  • Loading branch information
aomegax authored Dec 18, 2024
1 parent 11a1d56 commit 626f0f0
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
56 changes: 56 additions & 0 deletions src/domains/nodo-common/03_storage_account_wisp_converter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,34 @@ resource "azurerm_storage_table" "wisp_converter_table" {
]
}

resource "azurerm_private_endpoint" "wispconv_private_endpoint_table" {
count = var.env_short == "d" ? 0 : var.create_wisp_converter ? 1 : 0

name = "${local.project}-wisp-converter-private-endpoint-table"
location = var.location
resource_group_name = azurerm_resource_group.wisp_converter_rg[0].name
subnet_id = data.azurerm_subnet.private_endpoint_snet.id

private_dns_zone_group {
name = "${local.project}-wisp-converter-private-dns-zone-group-table"
private_dns_zone_ids = [data.azurerm_private_dns_zone.privatelink_table_azure_com.id]
}

private_service_connection {
name = "${local.project}-wisp-converter-private-service-connection-table"
private_connection_resource_id = module.wisp_converter_storage_account[0].id
is_manual_connection = false
subresource_names = ["table"]
}

tags = var.tags

depends_on = [
azurerm_resource_group.wisp_converter_rg,
module.wisp_converter_storage_account
]
}

# blob wispconverter
resource "azurerm_storage_container" "wisp_converter_container" {
count = var.create_wisp_converter ? 1 : 0
Expand All @@ -80,3 +108,31 @@ resource "azurerm_storage_container" "wisp_converter_container" {
module.wisp_converter_storage_account
]
}

resource "azurerm_private_endpoint" "wispconv_private_endpoint_blob" {
count = var.env_short == "d" ? 0 : var.create_wisp_converter ? 1 : 0

name = "${local.project}-wisp-converter-private-endpoint-blob"
location = var.location
resource_group_name = azurerm_resource_group.wisp_converter_rg[0].name
subnet_id = data.azurerm_subnet.private_endpoint_snet.id

private_dns_zone_group {
name = "${local.project}-wisp-converter-private-dns-zone-group-blob"
private_dns_zone_ids = [data.azurerm_private_dns_zone.privatelink_blob_azure_com.id]
}

private_service_connection {
name = "${local.project}-wisp-converter-private-service-connection-blob"
private_connection_resource_id = module.wisp_converter_storage_account[0].id
is_manual_connection = false
subresource_names = ["blob"]
}

tags = var.tags

depends_on = [
azurerm_resource_group.wisp_converter_rg,
module.wisp_converter_storage_account
]
}
2 changes: 1 addition & 1 deletion src/domains/nodo-common/env/weu-uat/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ wisp_converter_storage_account = {
blob_versioning_enabled = false
advanced_threat_protection = true
blob_delete_retention_days = 90
public_network_access_enabled = true
public_network_access_enabled = false
backup_enabled = false
backup_retention_days = 0
}
Expand Down

0 comments on commit 626f0f0

Please sign in to comment.