Skip to content

Commit

Permalink
Create a new secondary index instead of altering existing
Browse files Browse the repository at this point in the history
Editing the existing index failed with:
Resource handler returned message: "Cannot update GSI's properties other
than Provisioned Throughput and Contributor Insights Specification. You
can create a new GSI with a different name." (RequestToken:
b8bf0056-d503-81c6-ff7e-2801e104abed, HandlerErrorCode: InvalidRequest)
  • Loading branch information
tjmw committed Mar 19, 2024
1 parent 8a39ab5 commit de15edb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dynamo.cloudformation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ Resources:
StreamViewType: NEW_AND_OLD_IMAGES
GlobalSecondaryIndexes:
- IndexName: ios-endTimestamp-revalidation-index
KeySchema:
- AttributeName: subscriptionId
KeyType: HASH
- AttributeName: endTimestamp
KeyType: RANGE
Projection:
NonKeyAttributes:
- autoRenewing
- receipt
ProjectionType: INCLUDE
- IndexName: ios-endTimestamp-revalidation-index-with-platform
KeySchema:
- AttributeName: subscriptionId
KeyType: HASH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function handler(event: ScheduleEvent) {
const queryScan = dynamoMapper.scan(
EndTimeStampFilterSubscription,
{
indexName: 'ios-endTimestamp-revalidation-index',
indexName: 'ios-endTimestamp-revalidation-index-with-platform',
filter: filter
});

Expand Down

0 comments on commit de15edb

Please sign in to comment.