Skip to content

Commit

Permalink
Add identity index to DynamoDB (#2459)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperaj authored Dec 14, 2023
1 parent 4c8809e commit d823927
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion service-api/docker/seeding/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ if ! [[ -z "${AWS_ENDPOINT_DYNAMODB}" ]]; then
--region eu-west-1 \
--endpoint $DYNAMODN_ENDPOINT \
--global-secondary-indexes \
IndexName=IdentityIndex,KeySchema=["{AttributeName=Identity,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \
IndexName=EmailIndex,KeySchema=["{AttributeName=Email,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \
IndexName=NewEmailIndex,KeySchema=["{AttributeName=NewEmail,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \
IndexName=ActivationTokenIndex,KeySchema=["{AttributeName=ActivationToken,KeyType=HASH}"],Projection="{ProjectionType=KEYS_ONLY}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \
IndexName=PasswordResetTokenIndex,KeySchema=["{AttributeName=PasswordResetToken,KeyType=HASH}"],Projection="{ProjectionType=KEYS_ONLY}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}"\
IndexName=EmailResetTokenIndex,KeySchema=["{AttributeName=EmailResetToken,KeyType=HASH}"],Projection="{ProjectionType=KEYS_ONLY}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}"


aws dynamodb update-time-to-live \
--table-name ActorUsers \
--region eu-west-1 \
Expand Down
9 changes: 9 additions & 0 deletions terraform/environment/dynamodb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ resource "aws_dynamodb_table" "actor_users_table" {
name = "Id"
type = "S"
}
attribute {
name = "Identity"
type = "S"
}
attribute {
name = "Email"
type = "S"
Expand All @@ -113,6 +117,11 @@ resource "aws_dynamodb_table" "actor_users_table" {
type = "S"
}

global_secondary_index {
name = "IdentityIndex"
hash_key = "Identity"
projection_type = "ALL"
}
global_secondary_index {
name = "EmailIndex"
hash_key = "Email"
Expand Down

0 comments on commit d823927

Please sign in to comment.