gpt4 book ai didi

amazon-web-services - 属性投影不能为空

转载 作者:行者123 更新时间:2023-12-05 03:10:11 25 4
gpt4 key购买 nike

我正在尝试使用无服务器框架创建一个表,即使我已经为 GSI 指定了投影,无服务器仍提示属性 Projection 不能为空。我语法错误吗?如果我删除 GSI 部分,它工作得很好。

Table1: 
Type: "AWS::DynamoDB::Table"
Properties:
AttributeDefinitions:
- AttributeName: "uid"
AttributeType: "S"
- AttributeName: "bid"
AttributeType: "S"
KeySchema:
- AttributeName: "uid"
KeyType: "HASH"
- AttributeName: "bid"
KeyType: "RANGE"
GlobalSecondaryIndexes:
- IndexName: "bid-uid-index"
- KeySchema:
- AttributeName: "bid"
KeyType: "HASH"
- AttributeName: "uid"
KeyType: "RANGE"
- Projection:
- ProjectionType: "ALL"
- ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: "Table1"

最佳答案

没关系,我的语法错误

GlobalSecondaryIndexes:
- IndexName: "bid-uid-index"
KeySchema:
- AttributeName: "bid"
KeyType: "HASH"
- AttributeName: "uid"
KeyType: "RANGE"
Projection:
ProjectionType: "ALL"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1

将其更改为上面修复了错误...

关于amazon-web-services - 属性投影不能为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40823889/

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