I need to create a cloudformation template for my dynamodb, but I need one of the indexes to be incremented automatically. CloudFormation template looks like this:
TestTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: test-event-records
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: “UniqueId”
AttributeType: “N”
- AttributeName: “IsRestored”
AttributeType: “B”
- AttributeName: “EventName”
AttributeType: “S”
KeySchema:
- AttributeName: “UniqueId”
KeyType: “HASH”
- AttributeName: “IsRestored”
KeyType: “HASH”
- AttributeName: “EventName”
KeyType: “HASH”
Tags:
- Key: “AppGroup”
Value: !Ref “AppGroup”
- Key: “AppRole”
Value: “database”
- Key: “Environment”
Value: !Ref “Environment”
- Key: “Name”
Value: “test-event-records”
StreamSpecification:
StreamViewType: NEW_IMAGE
Here UniqueId (is of the type number and cannot be a UUID) has to be an auto-incremented value. I need to add new items to this new table in my .net core app.