aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 54 forks source link

Support DynamoDB GSI creation merging with existing indexes #881

Open IsaiahJTurner opened 3 years ago

IsaiahJTurner commented 3 years ago

It is not possible to create more than one GSI at once due to an error "Cannot perform more than one GSI creation or deletion in a single update" and the CloudFormation team seems to consider this (absurdly so) as a "wont fix". Unfortunately, it's not on the short term roadmap for DynamoDB either so an alternative solution is necessary.

Proposed solution: Support resolving drift of GSIs by updating those attributes in CloudFormation in a way that matches the existing state of the table.

This way, an engineer that experiences this bug with CloudFormation/DynamoDB can resolve it without creating incremental stack changes and deploying them sequentially. The flow would work like this:

  1. Engineer sees error "Cannot perform more than one GSI creation or deletion in a single update"
  2. Engineer manually creates those indexes in a way that matches the failed stack update.
  3. Engineer attempts to deploy the stack again.
  4. Instead of failing (because CloudFormation compares against the existing stack configuration), the stack update will succeed by skipping the UpdateTable indexes operation because it compares against the existing DynamoDB table configuration and determines there are no changes to indexes. The "change" would be relatively immediate because it is really just drift correction, not an update operation to dynamodb.
christophermichaelthomasmillar commented 1 year ago

It really blows my mind that the CloudFormation/DynamoDB teams don't see the status Quo as totally unacceptable and banana.