- Newest
- Most votes
- Most comments
If you have backups / snapshots or point-in-time-recovery, you can recreate the database from the backup. Without the backups, it is not possible to recover the database.
To avoid accidentally deleting critical resources, you can enable deletion protection for the resources in the future.
If your Amazon RDS instance was deleted with automated backups disabled and no final snapshot taken (i.e., skip-final-snapshot was set to true), AWS does not retain any automated backups or point-in-time restore options for that instance. In this scenario, AWS Support cannot recover the data, as there are no hidden or undeclared “backups” stored by RDS. The only viable restore is from any existing manual snapshots, such as your March 2025 snapshot. Unfortunately, if no manual snapshot exists covering the needed period, there’s no AWS-side way to resurrect lost data. The best course of action moving forward is to implement robust backup and snapshot policies, enable lifecycle protections like prevent_destroy, separate Terraform state files per environment, and avoid using -auto-approve in sensitive environments. For official documentation, see AWS’s guidance on RDS backups and data recovery (AWS RDS Backup and Restore).
For the recovery side, if automated backups had retention set to 0 and skip_final_snapshot was true, AWS cannot recover the data once the instance is deleted. Your only option is restoring from any existing manual snapshots. Check the RDS console under Snapshots > Manual to see if anything is there.
Going forward, the most important fixes for this specific situation:
- Enable deletion protection on all production RDS instances (this blocks deletes at the AWS API level regardless of what Terraform does)
- Set backup_retention_period to at least 7 days
- Never use -auto-approve on production workspaces
- Split your state files per environment - sharing a single S3 backend key across dev/staging/prod is what made Terraform treat prod as a fresh install
On prevent_destroy specifically, the hard part is that you can not pass it as a variable into a module. If you use community modules like terraform-aws-modules, the lifecycle blocks are inside the module and you would have to fork to add them. This is a known Terraform limitation going back to 2015. I wrote about this problem and how to solve it without forking here: https://compliance.tf/blog/stop-paying-the-terraform-fork-tax/ and https://compliance.tf/docs/rules/prevent_destroy_data/
Relevant content
- asked 3 years ago
- asked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 5 years ago
