From 1ff13f9e811752d646543d28994f600ed7b20095 Mon Sep 17 00:00:00 2001
From: Simone Infante <52280205+infantesimone@users.noreply.github.com>
Date: Wed, 18 Dec 2024 11:55:40 +0100
Subject: [PATCH 1/2] feat: add new product to support nodo,wallet and
eCommerce healtcheck
---
.../04_apim_ecommerce_healthcheck.tf | 2 +-
.../04_apim_payment_wallet_healthcheck.tf | 2 +-
.../04_apim_pagopa_platform_statuspage.tf | 21 +++++++++++++++++++
.../shared-app/04_apim_statuspage_ndp.tf | 2 +-
.../_pagopa_platform_statuspage_policy.xml | 14 +++++++++++++
5 files changed, 38 insertions(+), 3 deletions(-)
create mode 100644 src/domains/shared-app/04_apim_pagopa_platform_statuspage.tf
create mode 100644 src/domains/shared-app/api_product/_pagopa_platform_statuspage_policy.xml
diff --git a/src/domains/ecommerce-app/04_apim_ecommerce_healthcheck.tf b/src/domains/ecommerce-app/04_apim_ecommerce_healthcheck.tf
index 9d07c37249..883e257904 100644
--- a/src/domains/ecommerce-app/04_apim_ecommerce_healthcheck.tf
+++ b/src/domains/ecommerce-app/04_apim_ecommerce_healthcheck.tf
@@ -26,7 +26,7 @@ module "apim_ecommerce_healthcheck_api_v1" {
name = "${local.project}-healtcheck-api"
api_management_name = local.pagopa_apim_name
resource_group_name = local.pagopa_apim_rg
- product_ids = ["statuspage_nodo_pagamenti"]
+ product_ids = ["pagoPAPlatformStatusPage"]
subscription_required = local.apim_ecommerce_healthcheck_service_api.subscription_required
version_set_id = azurerm_api_management_api_version_set.ecommerce_healthcheck_api.id
api_version = "v1"
diff --git a/src/domains/pay-wallet-app/04_apim_payment_wallet_healthcheck.tf b/src/domains/pay-wallet-app/04_apim_payment_wallet_healthcheck.tf
index 14df2ef0b9..3e1af613ef 100644
--- a/src/domains/pay-wallet-app/04_apim_payment_wallet_healthcheck.tf
+++ b/src/domains/pay-wallet-app/04_apim_payment_wallet_healthcheck.tf
@@ -26,7 +26,7 @@ module "apim_pay_wallet_healthcheck_api_v1" {
name = "${local.project}-healtcheck-api"
api_management_name = local.pagopa_apim_name
resource_group_name = local.pagopa_apim_rg
- product_ids = ["statuspage_nodo_pagamenti"]
+ product_ids = ["pagoPAPlatformStatusPage"]
subscription_required = local.apim_payment_wallet_healthcheck_service_api.subscription_required
version_set_id = azurerm_api_management_api_version_set.pay_wallet_healthcheck_api.id
api_version = "v1"
diff --git a/src/domains/shared-app/04_apim_pagopa_platform_statuspage.tf b/src/domains/shared-app/04_apim_pagopa_platform_statuspage.tf
new file mode 100644
index 0000000000..0986a35730
--- /dev/null
+++ b/src/domains/shared-app/04_apim_pagopa_platform_statuspage.tf
@@ -0,0 +1,21 @@
+##############
+## Products ##
+##############
+
+module "apim_pagopa_platform_statuspage_product" {
+ source = "./.terraform/modules/__v3__/api_management_product"
+
+ product_id = "pagoPAPlatformStatusPage"
+ display_name = "pagoPA platform Status Page"
+ description = "Prodotto pagoPA platform Status Page"
+
+ api_management_name = local.pagopa_apim_name
+ resource_group_name = local.pagopa_apim_rg
+
+ published = true
+ subscription_required = true
+ approval_required = true
+ subscriptions_limit = 1000
+
+ policy_xml = file("./api_product/_pagopa_platform_statuspage_policy.xml")
+}
diff --git a/src/domains/shared-app/04_apim_statuspage_ndp.tf b/src/domains/shared-app/04_apim_statuspage_ndp.tf
index ec44e2b1f3..6bffc5f2cd 100644
--- a/src/domains/shared-app/04_apim_statuspage_ndp.tf
+++ b/src/domains/shared-app/04_apim_statuspage_ndp.tf
@@ -44,7 +44,7 @@ module "apim_api_statuspage_nodopagamenti_api_v1" {
name = format("%s-statuspage-nodopagamenti-api", local.project)
api_management_name = local.pagopa_apim_name
resource_group_name = local.pagopa_apim_rg
- product_ids = [module.apim_statuspage_nodo_pagamenti.product_id]
+ product_ids = [module.apim_statuspage_nodo_pagamenti.product_id,"pagoPAPlatformStatusPage"]
subscription_required = local.apim_statuspage_nodopagamenti_service_api.subscription_required
version_set_id = azurerm_api_management_api_version_set.api_statuspage_nodopagamenti_api.id
api_version = "v1"
diff --git a/src/domains/shared-app/api_product/_pagopa_platform_statuspage_policy.xml b/src/domains/shared-app/api_product/_pagopa_platform_statuspage_policy.xml
new file mode 100644
index 0000000000..ce18a37436
--- /dev/null
+++ b/src/domains/shared-app/api_product/_pagopa_platform_statuspage_policy.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 0c717b55864643201c9a53bd441ec9a114285c55 Mon Sep 17 00:00:00 2001
From: Simone Infante <52280205+infantesimone@users.noreply.github.com>
Date: Wed, 18 Dec 2024 12:01:11 +0100
Subject: [PATCH 2/2] chore: precommit refactoring
---
src/domains/ecommerce-app/README.md | 2 +-
src/domains/pay-wallet-common/03_storage.tf | 10 +++++-----
src/domains/shared-app/04_apim_statuspage_ndp.tf | 2 +-
src/domains/shared-app/README.md | 1 +
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/domains/ecommerce-app/README.md b/src/domains/ecommerce-app/README.md
index becfbf1797..c758d3ffc0 100644
--- a/src/domains/ecommerce-app/README.md
+++ b/src/domains/ecommerce-app/README.md
@@ -61,7 +61,6 @@
| [azurerm_api_management_api.apim_ecommerce_npg_mock](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api) | resource |
| [azurerm_api_management_api.apim_ecommerce_npg_notifications](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api) | resource |
| [azurerm_api_management_api.apim_ecommerce_pdv_mock](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api) | resource |
-| [azurerm_api_management_api_V2_operation_policy.get_transaction_info_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_V2_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.auth_request_gateway_policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.confirm_payment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.create_session](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
@@ -77,6 +76,7 @@
| [azurerm_api_management_api_operation_policy.get_payment_request_info_api_policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_state](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_transaction_info](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
+| [azurerm_api_management_api_operation_policy.get_transaction_info_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.get_transactions_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.helpdesk_pgs_vpos](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
| [azurerm_api_management_api_operation_policy.helpdesk_pgs_xpay](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api_operation_policy) | resource |
diff --git a/src/domains/pay-wallet-common/03_storage.tf b/src/domains/pay-wallet-common/03_storage.tf
index b9ab1782ed..c3b1e52f46 100644
--- a/src/domains/pay-wallet-common/03_storage.tf
+++ b/src/domains/pay-wallet-common/03_storage.tf
@@ -155,11 +155,11 @@ locals {
action_group = [data.azurerm_monitor_action_group.email.id, data.azurerm_monitor_action_group.slack.id, azurerm_monitor_action_group.payment_wallet_opsgenie[0].id]
},
{
- queue_key = "logged-action-dead-letter-queue"
- severity = 1
- time_window = 30
- frequency = 15
- threshold = 10
+ queue_key = "logged-action-dead-letter-queue"
+ severity = 1
+ time_window = 30
+ frequency = 15
+ threshold = 10
action_group = [data.azurerm_monitor_action_group.email.id, data.azurerm_monitor_action_group.slack.id, azurerm_monitor_action_group.payment_wallet_opsgenie[0].id]
},
] : []
diff --git a/src/domains/shared-app/04_apim_statuspage_ndp.tf b/src/domains/shared-app/04_apim_statuspage_ndp.tf
index 6bffc5f2cd..36fe6bf051 100644
--- a/src/domains/shared-app/04_apim_statuspage_ndp.tf
+++ b/src/domains/shared-app/04_apim_statuspage_ndp.tf
@@ -44,7 +44,7 @@ module "apim_api_statuspage_nodopagamenti_api_v1" {
name = format("%s-statuspage-nodopagamenti-api", local.project)
api_management_name = local.pagopa_apim_name
resource_group_name = local.pagopa_apim_rg
- product_ids = [module.apim_statuspage_nodo_pagamenti.product_id,"pagoPAPlatformStatusPage"]
+ product_ids = [module.apim_statuspage_nodo_pagamenti.product_id, "pagoPAPlatformStatusPage"]
subscription_required = local.apim_statuspage_nodopagamenti_service_api.subscription_required
version_set_id = azurerm_api_management_api_version_set.api_statuspage_nodopagamenti_api.id
api_version = "v1"
diff --git a/src/domains/shared-app/README.md b/src/domains/shared-app/README.md
index be52f551f8..668042560a 100644
--- a/src/domains/shared-app/README.md
+++ b/src/domains/shared-app/README.md
@@ -32,6 +32,7 @@
| [apim\_authorizer\_product](#module\_apim\_authorizer\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| [apim\_enrolled\_orgs\_product](#module\_apim\_enrolled\_orgs\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| [apim\_influxdb\_product](#module\_apim\_influxdb\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
+| [apim\_pagopa\_platform\_statuspage\_product](#module\_apim\_pagopa\_platform\_statuspage\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| [apim\_pdf\_engine\_product](#module\_apim\_pdf\_engine\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| [apim\_poc\_product](#module\_apim\_poc\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| [apim\_session\_wallet\_api\_v1](#module\_apim\_session\_wallet\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |