-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from nhsconnect/PRMT-4252-DYNAMODB
PRMT-4252-DYNAMODB
- Loading branch information
Showing
1 changed file
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |