diff --git a/services/terraform/dynamodb-test.tf b/services/terraform/dynamodb-test.tf --- a/services/terraform/dynamodb-test.tf +++ b/services/terraform/dynamodb-test.tf @@ -97,10 +97,23 @@ type = "S" } + attribute { + name = "DeviceID" + type = "S" + } + ttl { attribute_name = "Expire" enabled = true } + + global_secondary_index { + name = "DeviceID-index" + hash_key = "DeviceID" + write_capacity = 10 + read_capacity = 10 + projection_type = "ALL" + } } resource "aws_dynamodb_table" "tunnelbroker-verification-messages-test" { diff --git a/services/terraform/dynamodb.tf b/services/terraform/dynamodb.tf --- a/services/terraform/dynamodb.tf +++ b/services/terraform/dynamodb.tf @@ -97,10 +97,23 @@ type = "S" } + attribute { + name = "DeviceID" + type = "S" + } + ttl { attribute_name = "Expire" enabled = true } + + global_secondary_index { + name = "DeviceID-index" + hash_key = "DeviceID" + write_capacity = 10 + read_capacity = 10 + projection_type = "ALL" + } } resource "aws_dynamodb_table" "tunnelbroker-verification-messages" {