事象
DynamoDBをCloudFormationでデプロイしているが、GSIの設定をアップデートするときに、以下のエラーが発生した。
Cannot update GSI's properties other than Provisioned Throughput. You can create a new GSI with a different name
解決策
「更新」はできないので、「削除」してから「作成」する。
new dynamoDb.CfnTable(scope, '[tableName]', {
tableName: tableName,
attributeDefinitions: [...],
keySchema: [],
billingMode: ...,
tags: ...,
});
GSI設定を除いたものをデプロイする。
new dynamoDb.CfnTable(scope, '[tableName]', {
tableName: tableName,
attributeDefinitions: [...],
keySchema: [],
globalSecondaryIndexes: [],
billingMode: ...,
tags: ...,
});
GSI設定を含めたものをデプロイする。