Changeset View
Changeset View
Standalone View
Standalone View
services/terraform/dynamodb.tf
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | global_secondary_index { | ||||
name = "blobHash-index" | name = "blobHash-index" | ||||
hash_key = "blobHash" | hash_key = "blobHash" | ||||
write_capacity = 10 | write_capacity = 10 | ||||
read_capacity = 10 | read_capacity = 10 | ||||
projection_type = "ALL" | projection_type = "ALL" | ||||
} | } | ||||
} | } | ||||
resource "aws_dynamodb_table" "tunnelbroker-undelivered-messages" { | |||||
name = "tunnelbroker-undelivered-messages" | |||||
hash_key = "deviceID" | |||||
range_key = "createdAt" | |||||
write_capacity = 10 | |||||
read_capacity = 10 | |||||
attribute { | |||||
name = "deviceID" | |||||
type = "S" | |||||
} | |||||
attribute { | |||||
name = "createdAt" | |||||
type = "N" | |||||
} | |||||
bartek: In other places, we use the RFC3339 string as a timestamp. Not sure if it is a good candidate… | |||||
jonAuthorUnsubmitted Done Inline ActionsI just intend to use this to order the messages, so seconds from EPOCH seems like a simple yet effective way to achieve this. This also avoids having to parse the date back in. jon: I just intend to use this to order the messages, so seconds from EPOCH seems like a simple yet… | |||||
bartekUnsubmitted Done Inline ActionsThat makes sense, thanks for explaining bartek: That makes sense, thanks for explaining | |||||
} | |||||
resource "aws_dynamodb_table" "identity-users" { | resource "aws_dynamodb_table" "identity-users" { | ||||
name = "identity-users" | name = "identity-users" | ||||
hash_key = "userID" | hash_key = "userID" | ||||
write_capacity = 10 | write_capacity = 10 | ||||
read_capacity = 10 | read_capacity = 10 | ||||
attribute { | attribute { | ||||
name = "userID" | name = "userID" | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |
In other places, we use the RFC3339 string as a timestamp. Not sure if it is a good candidate for a range key though