如何通过从 CloudFormation 中删除 Global Secondary Index 从 DynamoDb 中删除它?

How to remove Global Secondary Index from DynamoDb by removing it from CloudFormation?

我有一个 table,在 CloudFormation 模板中指定了 GlobalSecondaryIndexes。

我想通过从 CloudFormation 模板中删除这些索引来从 DynamoDb 中删除它们,但是我在部署过程中遇到错误:"Property AttributeDefinitions is inconsistent with the KeySchema of the table and the secondary indexes"。

如果您发布 CF 模板会有所帮助,但无论如何我都会尝试一下..

定义中的AttributeDefinitions只能针对Key Schema或存在的索引中的属性,因为DynamoDB是无模式的。

如果要删除 GSI,则还需要删除那些属性定义(除非它们存在于基础 Table 的密钥架构或 LSI 中)。

HTH