I am trying to create a table using serverless framework and even though I have specified Projection for the GSI, serverless is complaining that property Projection cannot be empty.
Am I getting the syntax wrong?
If I remove the GSI section it works pretty fine.
Table1:
Type: "AWS::DynamoDB::Table"
Properties:
AttributeDefinitions:
- AttributeName: "uid"
AttributeType: "S"
- AttributeName: "bid"
AttributeType: "S"
KeySchema:
- AttributeName: "uid"
KeyType: "HASH"
- AttributeName: "bid"
KeyType: "RANGE"
GlobalSecondaryIndexes:
- IndexName: "bid-uid-index"
- KeySchema:
- AttributeName: "bid"
KeyType: "HASH"
- AttributeName: "uid"
KeyType: "RANGE"
- Projection:
- ProjectionType: "ALL"
- ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: "Table1"
Never mind, my syntax was wrong
GlobalSecondaryIndexes:
- IndexName: "bid-uid-index"
KeySchema:
- AttributeName: "bid"
KeyType: "HASH"
- AttributeName: "uid"
KeyType: "RANGE"
Projection:
ProjectionType: "ALL"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
Changin it to above fixed the errors...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With