From 18f6cde2a869e1a6a9d524626db0f15fb00c023f Mon Sep 17 00:00:00 2001 From: Daniel Yip Date: Wed, 15 Oct 2025 11:52:41 +0100 Subject: [PATCH] Add an index for searching on the immunisation ID --- terraform/dynamodb.tf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/terraform/dynamodb.tf b/terraform/dynamodb.tf index 5bf01ae20..22d60dcb7 100644 --- a/terraform/dynamodb.tf +++ b/terraform/dynamodb.tf @@ -68,6 +68,11 @@ resource "aws_dynamodb_table" "delta-dynamodb-table" { type = "S" } + attribute { + name = "ImmsID" + type = "S" + } + attribute { name = "Operation" type = "S" @@ -102,6 +107,12 @@ resource "aws_dynamodb_table" "delta-dynamodb-table" { projection_type = "ALL" } + global_secondary_index { + name = "ImmunisationIdIndex" + hash_key = "ImmsID" + projection_type = "ALL" + } + point_in_time_recovery { enabled = var.environment == "prod" }