diff --git a/terraform/dynamodb.tf b/terraform/dynamodb.tf index bb634df3e..8a61283b1 100644 --- a/terraform/dynamodb.tf +++ b/terraform/dynamodb.tf @@ -1,7 +1,8 @@ resource "aws_dynamodb_table" "transfer_tracker" { - name = "${var.environment}-${var.component_name}-transfer-tracker" - billing_mode = "PAY_PER_REQUEST" - hash_key = "conversation_id" + name = "${var.environment}-${var.component_name}-transfer-tracker" + billing_mode = "PAY_PER_REQUEST" + hash_key = "conversation_id" + deletion_protection_enabled = true server_side_encryption { enabled = true @@ -28,15 +29,14 @@ resource "aws_dynamodb_table" "transfer_tracker" { } global_secondary_index { - name = "NhsNumberSecondaryIndex" - hash_key = "nhs_number" - projection_type = "ALL" + name = "NhsNumberSecondaryIndex" + hash_key = "nhs_number" + projection_type = "ALL" } global_secondary_index { - name = "IsActiveSecondaryIndex" - hash_key = "is_active" - projection_type = "ALL" + name = "IsActiveSecondaryIndex" + hash_key = "is_active" + projection_type = "ALL" } - }