Skip to content

Problem recreating DynamoDB tables after they were deleted

0

I have an Amplify app that I am testing. There is no valuable data stored in this app. Somehow, there were null records that got into my DynamoDB tables. Kiro suggested that I delete the tables and recreate them by redeploying the app. I have tried this but the tables do not get recreated. How do I recreate the DynamoDB tables? I expect completely empty tables and would consider deleting the app from Amplify and completely recreating it. Any recommendations?

asked a year ago500 views

1 Answer
0

When DynamoDB tables are deleted, they don't automatically get recreated upon redeployment. Here are some approaches to recreate your tables:

  1. If you're using Amplify CLI, you can try running amplify push to redeploy your backend resources, which should recreate the deleted tables based on your Amplify configuration.

  2. If that doesn't work, you may need to update your Amplify configuration:

  • Run amplify update storage to modify your DynamoDB configuration
  • Make a small change to force recreation of the resources
  • Then run amplify push again
  1. If you're still having issues, you could try removing the storage resource completely:
  • Run amplify remove storage
  • Then add it back with amplify add storage
  • Finally, push the changes with amplify push
  1. As a last resort, you could delete the entire Amplify app and recreate it:
  • Back up any important configuration
  • Delete the app from the Amplify console
  • Run amplify init to create a new project
  • Reconfigure your resources
  • Deploy with amplify push

When DynamoDB tables are deleted with Point-in-Time Recovery (PITR) enabled, the system creates a backup snapshot at deletion time, but this doesn't automatically recreate the tables. You would need to explicitly restore from that backup if needed, but since you mentioned you don't have valuable data, recreating fresh tables is likely the better approach.
Sources
Do You Lose PITR for a Deleted DynamoDB Table? | AWS re:Post
Point in Time Recovery on Deleted Tables | AWS re:Post
Use DeleteTable with an AWS SDK or CLI - Amazon DynamoDB

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.