Basically need configure a DynamoDB table with a Global Secondary Index that projects a Map type attribute. Would this configuration work?
Resources:
DynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: email_id
AttributeType: S
- AttributeName: user_id
AttributeType: N
- AttributeName: metrics
AttributeType: M
KeySchema:
- AttributeName: email_id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 50
WriteCapacityUnits: 5
TableName: ${self:custom.dynamoDBTable}
GlobalSecondaryIndexes:
- IndexName: user_id-index
KeySchema:
- AttributeName: user_id
KeyType: HASH
Projection:
ProjectionType: INCLUDE
NonKeyAttributes:
- metrics
ProvisionedThroughput:
ReadCapacityUnits: 50
WriteCapacityUnits: 5