Skip to content

Commit

Permalink
Merge pull request #16 from nhsconnect/PRMT-4252-DYNAMODB
Browse files Browse the repository at this point in the history
PRMT-4252-DYNAMODB
  • Loading branch information
chrisbloe-nhse authored Dec 1, 2023
2 parents 487c1af + 28c4143 commit 9ca5da0
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions terraform/dynamodb.tf
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
# The MHS DynamoDB state table, for storing state for each message handled
resource "aws_dynamodb_table" "mhs_state_table" {
name = "${var.environment}-${var.cluster_name}-mhs-state"
hash_key = "key"
read_capacity = var.mhs_state_table_read_capacity
write_capacity = var.mhs_state_table_write_capacity
name = "${var.environment}-${var.cluster_name}-mhs-state"
hash_key = "key"
read_capacity = var.mhs_state_table_read_capacity
write_capacity = var.mhs_state_table_write_capacity
deletion_protection_enabled = true

point_in_time_recovery {
enabled = true
}

attribute {
name = "key"
type = "S"
}

tags = {
Name = "${var.environment}-${var.cluster_name}-mhs-state-table"
Name = "${var.environment}-${var.cluster_name}-mhs-state-table"
Environment = var.environment
CreatedBy = var.repo_name
CreatedBy = var.repo_name
}
}

# The MHS DynamoDB sync-async table, used as a queue for the sync-async workflow
resource "aws_dynamodb_table" "mhs_sync_async_table" {
name = "${var.environment}-${var.cluster_name}-mhs-sync-async-state"
hash_key = "key"
read_capacity = var.mhs_sync_async_table_read_capacity
write_capacity = var.mhs_sync_async_table_write_capacity
name = "${var.environment}-${var.cluster_name}-mhs-sync-async-state"
hash_key = "key"
read_capacity = var.mhs_sync_async_table_read_capacity
write_capacity = var.mhs_sync_async_table_write_capacity
deletion_protection_enabled = true

point_in_time_recovery {
enabled = true
}

attribute {
name = "key"
type = "S"
}

tags = {
Name = "${var.environment}-${var.cluster_name}-mhs-sync-async-table"
Name = "${var.environment}-${var.cluster_name}-mhs-sync-async-table"
Environment = var.environment
CreatedBy = var.repo_name
CreatedBy = var.repo_name
}
}

0 comments on commit 9ca5da0

Please sign in to comment.