I am trying to create DynamoDB table with AWS Cloudformation and YAML defintions. When I remove the Type from YAML file I get error that Type must be present. So I suppose I am missing something just can't seem to find it.
Here are the YAML defintions:
Resources:
devDdbDataTable:
Type: 'AWS::DynamoDB::Table'
Properties:
Tags:
- Key: access_key
Value: '123'
AttributeDefinitions:
- AttributeName: device_id
Type: 'N'
- AttributeName: device_ip
Type: S
- AttributeName: data
Type: S
- AttributeName: created_at
Type: S
- AttributeName: ttl
Type: S
KeySchema:
- AttributeName: device_id
Type: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TimeToLiveSpecification:
AttributeName: ttl
Enabled: true
The problem is not at Resources.devDdbDataTable.Type
but instead the problem is at Resources.devDdbDataTable.Properties.AttributeDefinitions.Type
.
AttributeDefinitions
should be a list like this:
AttributeDefinitions:
- AttributeName: device_id
AttributeType: 'N'
So change Type
to AttributeType
.
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