Skip to content

Commit

Permalink
feat(wallet-common & pay-wallet-common): add expiration storage queue (
Browse files Browse the repository at this point in the history
…#2133)

* feat(wallet-common): add expiration storage queue

* fix: pre-commit
  • Loading branch information
pietro-tota authored Jun 12, 2024
1 parent 91a8793 commit 5e2ef67
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 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 @@ -68,6 +68,18 @@ resource "azurerm_storage_queue" "pay_wallet_usage_update_queue_blue" {
storage_account_name = module.pay_wallet_storage[0].name
}

resource "azurerm_storage_queue" "pay_wallet_wallet_expiration_queue" {
name = "${local.project}-expiration-queue"
storage_account_name = module.pay_wallet_storage[0].name
}

//storage queue for blue deployment
resource "azurerm_storage_queue" "pay_wallet_wallet_expiration_queue_blue" {
count = var.env_short == "u" ? 1 : 0
name = "${local.project}-expiration-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 @@ -122,6 +134,13 @@ locals {
frequency = 15
threshold = 10
},
{
queue_key = "expiration-queue"
severity = 1
time_window = 30
frequency = 15
threshold = 10
},
] : []
}

Expand Down
2 changes: 2 additions & 0 deletions src/domains/pay-wallet-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
| [azurerm_resource_group.storage_pay_wallet_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
| [azurerm_storage_queue.pay_wallet_usage_update_queue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource |
| [azurerm_storage_queue.pay_wallet_usage_update_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 |
| [azuread_group.adgroup_admin](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group) | data source |
| [azuread_group.adgroup_developers](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group) | data source |
| [azuread_group.adgroup_externals](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group) | data source |
Expand Down
19 changes: 19 additions & 0 deletions src/domains/wallet-common/03_storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ resource "azurerm_storage_queue" "wallet_usage_update_queue_blue" {
storage_account_name = module.wallet_storage.name
}

resource "azurerm_storage_queue" "wallet_expiration_queue" {
name = "${local.project}-expiration-queue"
storage_account_name = module.wallet_storage.name
}

//storage queue for blue deployment
resource "azurerm_storage_queue" "wallet_expiration_queue_blue" {
count = var.env_short == "u" ? 1 : 0
name = "${local.project}-expiration-queue-b"
storage_account_name = module.wallet_storage.name
}

# wallet queue alert diagnostic settings
resource "azurerm_monitor_diagnostic_setting" "wallet_queue_diagnostics" {
count = var.env_short == "p" ? 1 : 0
Expand Down Expand Up @@ -136,6 +148,13 @@ locals {
"frequency" = 15
"threshold" = 10
},
{
"queue_key" = "expiration-queue"
"severity" = 1
"time_window" = 30
"frequency" = 15
"threshold" = 10
},
] : []
}

Expand Down
2 changes: 2 additions & 0 deletions src/domains/wallet-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
| [azurerm_resource_group.sec_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
| [azurerm_resource_group.storage_wallet_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
| [azurerm_resource_group.wallet_fe_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
| [azurerm_storage_queue.wallet_expiration_queue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource |
| [azurerm_storage_queue.wallet_expiration_queue_blue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource |
| [azurerm_storage_queue.wallet_usage_update_queue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource |
| [azurerm_storage_queue.wallet_usage_update_queue_blue](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_queue) | resource |
| [azuread_group.adgroup_admin](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group) | data source |
Expand Down

0 comments on commit 5e2ef67

Please sign in to comment.