Skip to content

Commit

Permalink
Merge branch 'CHK-3573-mapping-outcome-25' of https://github.com/pago…
Browse files Browse the repository at this point in the history
…pa/pagopa-infra into CHK-3573-mapping-outcome-25
  • Loading branch information
EmanueleBVtech committed Dec 20, 2024
2 parents 1e70fa8 + 6487454 commit a9503a2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 56 deletions.
55 changes: 0 additions & 55 deletions src/domains/gps-app/04_apim_gps.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,58 +19,3 @@ module "apim_gps_product" {

policy_xml = file("./api_product/_base_policy_no_forbid.xml")
}

#################
## API GPS ##
#################

#################
# Depreacted ⚠️⚠️⚠️⚠️⚠️⚠️⚠️ see here https://github.com/pagopa/pagopa-spontaneous-payments/blob/378d08505a12e1dbd83d69c2ea987a2a3ee475a1/infra/04_apim_api.tf#L4
#################

locals {
apim_spontaneous_payments_service_api = {
display_name = "GPS pagoPA - spontaneous payments service API"
description = "API to support spontaneous payments service"
path = "gps/spontaneous-payments-service"
subscription_required = false
service_url = null
}
}

resource "azurerm_api_management_api_version_set" "api_gps_api" {

name = format("%s-spontaneous-payments-service-api", var.env_short)
resource_group_name = local.pagopa_apim_rg
api_management_name = local.pagopa_apim_name
display_name = local.apim_spontaneous_payments_service_api.display_name
versioning_scheme = "Segment"
}


module "apim_api_gps_api_v1" {
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-spontaneous-payments-service-api", local.project)
api_management_name = local.pagopa_apim_name
resource_group_name = local.pagopa_apim_rg
product_ids = [module.apim_gps_product.product_id]
subscription_required = local.apim_spontaneous_payments_service_api.subscription_required
version_set_id = azurerm_api_management_api_version_set.api_gps_api.id
api_version = "v1"

description = local.apim_spontaneous_payments_service_api.description
display_name = local.apim_spontaneous_payments_service_api.display_name
path = local.apim_spontaneous_payments_service_api.path
protocols = ["https"]
service_url = local.apim_spontaneous_payments_service_api.service_url

content_format = "openapi"
content_value = templatefile("./api/spontaneous-payments-service/v1/_openapi.json.tpl", {
host = local.apim_hostname
})

xml_content = templatefile("./api/spontaneous-payments-service/v1/_base_policy.xml", {
hostname = local.gps_hostname
})
}
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 a9503a2

Please sign in to comment.