【发布时间】:2021-04-24 02:59:02
【问题描述】:
我想在 Cloudformation 中为我的 DynamoDB 表设置一些属性,但出现此错误:
代码:
DynamoDB:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: UserId
AttributeType: S
- AttributeName: Username
AttributeType: S
- AttributeName: Surname
AttributeType: S
- AttributeName: Email
AttributeType: S
BillingMode: PAY_PER_REQUEST
KeySchema:
- AttributeName: UserId
KeyType: HASH
错误:
E3039 AttributeDefinitions 中的属性集:['Email', 'Surname', 'UserId', 'Username'] 和 KeySchemas: ['UserId'] 必须在 Resources/User/Properties 匹配
【问题讨论】:
-
只有用作键的属性必须预先声明
标签: amazon-web-services nosql amazon-dynamodb amazon-cloudformation