gpt4 book ai didi

amazon-dynamodb - DynamoDB/CF - 超出订阅者限制 : Only 10 tables can be created, 更新或同时删除

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

当我尝试使用 serverless.yml 创建 24 个 DynamoDB 表时,出现以下错误。我该如何规避这个问题?

Serverless: Checking Stack update progress…
.................................................................Serverless: Deployment failed!

Serverless Error ---------------------------------------

An error occurred while provisioning your stack: TestUserTable
- Subscriber limit exceeded: Only 10 tables can be created,
updated, or deleted simultaneously.
Your Environment Information -----------------------------
OS: linux
Node Version: 6.6.0
Serverless Version: 1.1.0

这似乎是 Cloudformation 的一个普遍问题,以下是 AWS 论坛中的解决方法:https://forums.aws.amazon.com/thread.jspa?threadID=167996

我尝试添加dependson,但仍然无法解决问题。

我收到以下错误

ServerlessError: Template format error: Unresolved resource dependencies [Dev1ProductTables] in the Resources block of the template

DependsOn: "DevPolicyTable" 放在引号中也没有任何区别

resources:
Resources:
DevUserTable:
Type: "AWS::DynamoDB::Table"
DependsOn: DevPolicyTable
Properties:
AttributeDefinitions:
- AttributeName: "id"
AttributeType: "S"
KeySchema:
- AttributeName: "id"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: "b1-dev-user"
DevPolicyTable:
Type: "AWS::DynamoDB::Table"
DependsOn: DevClaimTable
Properties:
AttributeDefinitions:
- AttributeName: "id"
AttributeType: "S"
KeySchema:
- AttributeName: "id"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: "b1-dev-policy"

最佳答案

您超出了并行创建的表的数量,解决此问题的最简单方法是使用 DependsOn。您可以将表依赖关系设置到另一个表中,这样在创建依赖表之前不会创建该表。

在此示例中,在创建表 2 之前不会创建表 1,因此它们不是并行创建的。

"Table1": {
"Type": "AWS::DynamoDB::Table",
"DependsOn": [
"Table2"
],
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "key",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "key",
"KeyType": "HASH"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": "2",
"WriteCapacityUnits": "2"
},
"TableName": {
"table1"
}
},
"Table2": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "key",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "key",
"KeyType": "HASH"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": "2",
"WriteCapacityUnits": "2"
},
"TableName": {
"table2"
}
}

关于amazon-dynamodb - DynamoDB/CF - 超出订阅者限制 : Only 10 tables can be created, 更新或同时删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40442288/

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