Created
May 17, 2017 23:59
-
-
Save Pwntus/6988f8253c97d3c44f0743d0ef2c9c18 to your computer and use it in GitHub Desktop.
SLS DynamoDB GSI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources: | |
Resources: | |
MyTableResource: | |
Type: AWS::DynamoDB::Table | |
Properties: | |
TableName: my-table-name | |
ProvisionedThroughput: | |
ReadCapacityUnits: 5 | |
WriteCapacityUnits: 5 | |
AttributeDefinitions: | |
- AttributeName: name | |
AttributeType: S | |
- AttributeName: category | |
AttributeType: S | |
- AttributeName: date | |
AttributeType: N | |
# Partition key: name | |
KeySchema: | |
- AttributeName: name | |
KeyType: HASH | |
# GSI: CategoryDate | |
# Partition key: category | |
# Sort key: date | |
GlobalSecondaryIndexes: | |
- IndexName: CategoryDate | |
KeySchema: | |
- AttributeName: category | |
KeyType: HASH | |
- AttributeName: date | |
KeyType: RANGE | |
# Project all attributes into the index | |
Projection: | |
ProjectionType: ALL | |
ProvisionedThroughput: | |
ReadCapacityUnits: 5 | |
WriteCapacityUnits: 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment