gpt4 book ai didi

amazon-web-services - AttributeDefinitions 和 KeySchema 中的属性集必须在 Resources/DynamoDB/Properties 中匹配

转载 作者:行者123 更新时间:2023-12-03 07:18:45 25 4
gpt4 key购买 nike

我想在 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 The set of Attributes in AttributeDefinitions: ['Email', 'Surname', 'UserId', 'Username'] and KeySchemas: ['UserId'] must match at Resources/User/Properties

最佳答案

documentation

The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.

The sort key of an item is also known as its range attribute. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.

这里What is Hash and Range Primary Key?您可以找到详尽的答案。

关于amazon-web-services - AttributeDefinitions 和 KeySchema 中的属性集必须在 Resources/DynamoDB/Properties 中匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65797791/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com