From 3913ed09323d271f65b58f862b4df19a148bf872 Mon Sep 17 00:00:00 2001 From: Tom Wey Date: Tue, 19 Mar 2024 13:00:37 +0000 Subject: [PATCH] Create a new secondary index instead of altering existing 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) --- dynamo.cloudformation.yaml | 11 +++++++++++ .../revalidate-receipts/appleRevalidateReceipts.ts | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dynamo.cloudformation.yaml b/dynamo.cloudformation.yaml index a888c8098..17655e6a0 100644 --- a/dynamo.cloudformation.yaml +++ b/dynamo.cloudformation.yaml @@ -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 diff --git a/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts b/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts index 5af19e1ad..1912291e2 100644 --- a/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts +++ b/typescript/src/revalidate-receipts/appleRevalidateReceipts.ts @@ -59,7 +59,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 });