Skip to content

Commit b5fdfe4

Browse files
committed
Change back to apply. Add deletion protection to all DDB tables.
1 parent 98013e4 commit b5fdfe4

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

azure/templates/post-prod-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ steps:
3838
cd terraform
3939
4040
make init environment=${{ parameters.aws_account_type }} sub_environment=$workspace
41-
make plan environment=${{ parameters.aws_account_type }} sub_environment=$workspace
41+
make apply environment=${{ parameters.aws_account_type }} sub_environment=$workspace
4242
fi
4343
displayName: Apply Terraform
4444
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)"

terraform/dynamodb.tf

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
resource "aws_dynamodb_table" "audit-table" {
2-
name = "immunisation-batch-${local.resource_scope}-audit-table"
3-
billing_mode = "PAY_PER_REQUEST"
4-
hash_key = "message_id"
2+
name = "immunisation-batch-${local.resource_scope}-audit-table"
3+
billing_mode = "PAY_PER_REQUEST"
4+
hash_key = "message_id"
5+
deletion_protection_enabled = true
56

67
attribute {
78
name = "message_id"
@@ -47,9 +48,10 @@ resource "aws_dynamodb_table" "audit-table" {
4748
}
4849

4950
resource "aws_dynamodb_table" "delta-dynamodb-table" {
50-
name = "imms-${local.resource_scope}-delta"
51-
billing_mode = "PAY_PER_REQUEST"
52-
hash_key = "PK"
51+
name = "imms-${local.resource_scope}-delta"
52+
billing_mode = "PAY_PER_REQUEST"
53+
hash_key = "PK"
54+
deletion_protection_enabled = true
5355

5456
attribute {
5557
name = "PK"
@@ -106,11 +108,12 @@ resource "aws_dynamodb_table" "delta-dynamodb-table" {
106108
}
107109

108110
resource "aws_dynamodb_table" "events-dynamodb-table" {
109-
name = "imms-${local.resource_scope}-imms-events"
110-
billing_mode = "PAY_PER_REQUEST"
111-
hash_key = "PK"
112-
stream_enabled = true
113-
stream_view_type = "NEW_IMAGE"
111+
name = "imms-${local.resource_scope}-imms-events"
112+
billing_mode = "PAY_PER_REQUEST"
113+
hash_key = "PK"
114+
stream_enabled = true
115+
stream_view_type = "NEW_IMAGE"
116+
deletion_protection_enabled = true
114117

115118
attribute {
116119
name = "PK"

0 commit comments

Comments
 (0)