Skip to content

Commit

Permalink
feat: add dead letter storage queue (#2617)
Browse files Browse the repository at this point in the history
  • Loading branch information
pietro-tota authored Dec 3, 2024
1 parent bdccc62 commit fc516cd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
19 changes: 19 additions & 0 deletions src/domains/pay-wallet-common/03_storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
},
] : []
}

Expand Down
6 changes: 4 additions & 2 deletions src/domains/pay-wallet-common/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# payment-wallet-common

<!-- markdownlint-disable -->
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -150,4 +152,4 @@
## Outputs

No outputs.
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END_TF_DOCS -->

0 comments on commit fc516cd

Please sign in to comment.