Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a new GSI to support the API endpoint returning the submission names sorted by creation time #799

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions aws/dynamodb/dynamo.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,26 @@ resource "aws_dynamodb_table" "vault" {
type = "S"
}

attribute {
name = "Status#CreatedAt"
type = "S"
}

global_secondary_index {
name = "Status"
hash_key = "FormID"
range_key = "Status"
projection_type = "ALL"
}

global_secondary_index {
name = "StatusCreatedAt"
hash_key = "FormID"
range_key = "Status#CreatedAt"
projection_type = "INCLUDE"
non_key_attributes = ["CreatedAt", "Name"]
}

server_side_encryption {
enabled = true
kms_key_arn = var.kms_key_dynamodb_arn
Expand Down
1 change: 1 addition & 0 deletions lambda-code/reliability/lib/dataLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export async function saveToVault(
CreatedAt: Number(createdAt),
SecurityAttribute: securityAttribute,
Status: "New",
"Status#CreatedAt": `New#${Number(createdAt)}`,
ConfirmationCode: confirmationCode,
Name: name,
FormSubmissionHash: formSubmissionHash,
Expand Down
57 changes: 0 additions & 57 deletions localstack_migration.sh

This file was deleted.