9
votes

I'm working on a Serverless web application and I'm trying to create a CloudFormation YAML template for a DynamoDB table. The documentation says that each attribute in the table should follow the style below, where AttributeType can be either 'S', 'N' or 'B', for string, number or binary.

AttributeName: String
AttributeType: String

My table includes attributes that are maps. How do I include them in the template?

1

1 Answers

12
votes

When creating the Dynamodb table, you dont need to mention all the attributes of the table. Only two attributes are mandatory while creating the table I.e. partition key and sort key if available.

As you have mentioned that the attribute is map, definitely it can't be partition key or sort key because key attributes can only be scalar data type.

The simple answer is you dont need to define the map attribute (document data type) in CloudFormation create table script.