RDS Backup & Recovery

"Amazon RDS creates and saves automated backups of your DB instance during the backup window of your DB instance. RDS creates a storage volume snapshot of your DB instance, backing up the entire DB instance and not just individual databases. RDS saves the automated backups of your DB instance according to the backup retention period that you specify. If necessary, you can recover your database to any point in time during the backup retention period. "

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html

Check

aws rds describe-db-instances --output table | grep -E 'Backup|DBInstanceIdentifier|LatestRestorableTime'

aws rds describe-db-instance-automated-backups --output table | grep -E 'DBInstanceIdentifier|Time'

Change Backup Retention Period

aws rds modify-db-instance \

    --db-instance-identifier mydbinstance  \

    --backup-retention-period 3 \

    --apply-immediately

Restore

Note: restoring will always create a new database instance.Note: if the database forms part of a Cloudformation Stack you should restore via Cloudformation and not using these instructions. Or, you can restore using this method then backup and restore to a CloudFormation created RDS instance using standard PostgreSQL backup tools.

To confirm available backups etc...

aws rds describe-db-instance-automated-backups --db-instance-identifier DBInstanceIdentifier

To restore to the latest available point in time...

aws rds restore-db-instance-to-point-in-time \

    --source-dbi-resource-id SourceDbiResourceId \

    --target-db-instance-identifier TargetDBInstanceIdentifier \

    --use-latest-restorable-time

To restore to a specific point in time...

aws rds restore-db-instance-to-point-in-time \

    --target-db-instance-identifier TargetDBInstanceIdentifier \

Bibliography