如何一次从 CloudFormation 中删除多个 Global Secondary Index?

How to delete more than one Global Secondary Index from the CloudFormation at once?

我在 CloudFormation 模板中描述了很多全局二级索引。 当我尝试删除多个时,出现此错误 "An error occurred: TodosDynamoDbTable - Cannot perform more than one GSI creation or deletion in a single update."。

如何一次从模板中删除多个 GSI?也许我可以从 table 中手动删除它们,然后执行模板更新,或者我可以使用一些属性(比如 "DependsOn")?

不幸的是,这是不可能的,至少现在不可能。您必须多次更新堆栈,一次删除一个。

正如 Miles 所提到的,目前无法将标准 CloudFormation 模板与 DynamoDB 资源一起使用。 但是,您可以在 CloudFormation 中创建一个自定义资源来触发 Lambda,它可以 create/update/delete GSIs as you