What is the best way to modify a DynamoDB table structure (no problems on erasing it because of backup)? I have a table with only HASH KEY. I have to add a SORT KEY for the table.
When I deploy the stack I receive this error
Error: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [DynamoDBTransactionsFinished] in the Resources block of the template
Some way to solve it?
CodePudding user response:
Here is what I what do. You have references in your template to the DynamoDB table that will fail if you simply delete the DynamoDB table resource from your template, so I would:
- add a secondary table that matches the first, re-point all references from the 1st table to the 2nd table
- delete the first table
- re-deploy your stack
- modify the template again to re-add the first table, but this time with the additional sort key
- re-point the references to the new 1st table
- delete the 2nd table
- re-deploy the stack