So I've been encountering this issue during serverless deployment:
ServerlessError: An error occurred: MyDdbTable - Cannot perform more than one GSI creation or deletion in a single update.
My DDB table configuration is this: Configuration in serverless.yml
AttributeDefinitions:
- AttributeName: externalId
AttributeType: S
- AttributeName: code
AttributeType: S
- AttributeName: accountId
AttributeType: S
KeySchema:
- AttributeName: externalId
KeyType: HASH
- AttributeName: code
KeyType: RANGE
GlobalSecondaryIndexes:
- IndexName: gsi-account-id
KeySchema:
- AttributeName: accountId
KeyType: HASH
- AttributeName: code
KeyType: RANGE
Projection:
ProjectionType: ALL
- IndexName: externalId
KeySchema:
- AttributeName: externalId
KeyType: HASH
Projection:
ProjectionType: ALL
- IndexName: code
KeySchema:
- AttributeName: code
KeyType: RANGE
Projection:
ProjectionType: ALL
Additional information:
- One (1) index is already existing which is the
gsi-account-id
where it has two (2) keySchema,accountId
and thecode
- I added two (2) additional index which are
externalId
andcode
Objective/s:
My goal is to add those two (2) additional indexes (externalId
and code
) but upon doing a serverless deployment, I always encounter the issue said above.
Questions:
- Do I encounter this issue because the code is already existing in the first's keySchema (gsi-account-id)?
- Do you have any idea/suggestion on why do I encounter this issue if the #1 is not the answer?
Thank you for those who'll help me on this. ❤️