From b2e109106f7dd0304e1071fc1dbb6ca43396921f Mon Sep 17 00:00:00 2001 From: Steve Buxton Date: Tue, 10 Feb 2026 15:24:50 +0000 Subject: [PATCH 1/2] CCM-12935 Add LetterQueue table --- .../components/api/ddb_table_letter_queue.tf | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 infrastructure/terraform/components/api/ddb_table_letter_queue.tf diff --git a/infrastructure/terraform/components/api/ddb_table_letter_queue.tf b/infrastructure/terraform/components/api/ddb_table_letter_queue.tf new file mode 100644 index 00000000..50ff4ac7 --- /dev/null +++ b/infrastructure/terraform/components/api/ddb_table_letter_queue.tf @@ -0,0 +1,44 @@ +resource "aws_dynamodb_table" "letters" { + name = "${local.csi}-letter-queue" + billing_mode = "PAY_PER_REQUEST" + + hash_key = "supplierId" + range_key = "letterId" + + ttl { + attribute_name = "ttl" + enabled = true + } + + local_secondary_index { + name = "timestamp-index" + range_key = "queueTimestamp" + projection_type = "ALL" + } + + attribute { + name = "supplierId" + type = "S" + } + + attribute { + name = "letterId" + type = "S" + } + + attribute { + name = "queueTimestamp" + type = "S" + } + + point_in_time_recovery { + enabled = true + } + + tags = merge( + local.default_tags, + { + NHSE-Enable-Dynamo-Backup-Acct = "True" + } + ) +} From b503e678536f2f625f873f57496bb87745902fac Mon Sep 17 00:00:00 2001 From: Steve Buxton Date: Tue, 10 Feb 2026 15:39:42 +0000 Subject: [PATCH 2/2] Fix name of resource --- .../terraform/components/api/ddb_table_letter_queue.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/terraform/components/api/ddb_table_letter_queue.tf b/infrastructure/terraform/components/api/ddb_table_letter_queue.tf index 50ff4ac7..83cf1f24 100644 --- a/infrastructure/terraform/components/api/ddb_table_letter_queue.tf +++ b/infrastructure/terraform/components/api/ddb_table_letter_queue.tf @@ -1,4 +1,4 @@ -resource "aws_dynamodb_table" "letters" { +resource "aws_dynamodb_table" "letter-queue" { name = "${local.csi}-letter-queue" billing_mode = "PAY_PER_REQUEST"