From fc516cda8d2261f995bc338ad28e6c42d0bc3e44 Mon Sep 17 00:00:00 2001 From: Pietro Tota <115724836+pietro-tota@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:49:52 +0100 Subject: [PATCH] feat: add dead letter storage queue (#2617) --- src/domains/pay-wallet-common/03_storage.tf | 19 +++++++++++++++++++ src/domains/pay-wallet-common/README.md | 6 ++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/domains/pay-wallet-common/03_storage.tf b/src/domains/pay-wallet-common/03_storage.tf index 21d34fdfcb..baaf638394 100644 --- a/src/domains/pay-wallet-common/03_storage.tf +++ b/src/domains/pay-wallet-common/03_storage.tf @@ -79,6 +79,18 @@ resource "azurerm_storage_queue" "pay_wallet_cdc_queue_blue" { storage_account_name = module.pay_wallet_storage[0].name } +resource "azurerm_storage_queue" "pay_wallet_logged_action_dead_letter_queue" { + name = "${local.project}-logged-action-dead-letter-queue" + storage_account_name = module.pay_wallet_storage[0].name +} + +//storage queue for blue deployment +resource "azurerm_storage_queue" "pay_wallet_logged_action_dead_letter_queue_blue" { + count = var.env_short == "u" ? 1 : 0 + name = "${local.project}-logged-action-dead-letter-queue-b" + storage_account_name = module.pay_wallet_storage[0].name +} + # wallet queue alert diagnostic settings resource "azurerm_monitor_diagnostic_setting" "pay_wallet_queue_diagnostics" { count = var.is_feature_enabled.storage && var.env_short == "p" ? 1 : 0 @@ -140,6 +152,13 @@ locals { frequency = 15 threshold = 10 }, + { + queue_key = "logged-action-dead-letter-queue" + severity = 1 + time_window = 30 + frequency = 15 + threshold = 10 + }, ] : [] } diff --git a/src/domains/pay-wallet-common/README.md b/src/domains/pay-wallet-common/README.md index f9b23f7e45..c29ad2539f 100644 --- a/src/domains/pay-wallet-common/README.md +++ b/src/domains/pay-wallet-common/README.md @@ -1,7 +1,7 @@ # payment-wallet-common - + ## Requirements | Name | Version | @@ -81,6 +81,8 @@ | [azurerm_resource_group.wallet_fe_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | | [azurerm_storage_queue.pay_wallet_cdc_queue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource | | [azurerm_storage_queue.pay_wallet_cdc_queue_blue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource | +| [azurerm_storage_queue.pay_wallet_logged_action_dead_letter_queue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource | +| [azurerm_storage_queue.pay_wallet_logged_action_dead_letter_queue_blue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource | | [azurerm_storage_queue.pay_wallet_wallet_expiration_queue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource | | [azurerm_storage_queue.pay_wallet_wallet_expiration_queue_blue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource | | [azurerm_subnet.pay_wallet_user_aks_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) | resource | @@ -150,4 +152,4 @@ ## Outputs No outputs. - +