Skip to content

RDS restoration from backup vault currently continues backup enabled backup plan

0

Hi, we are currently enabled the backup plan with the continuous backup for RDS and we want to restore the RDS through CFT, it's possible restoration through CFT.

2 Answers
0

Hi,

When AWS Backup continuous backup is enabled for an RDS instance, it takes over management of the RDS automated backup settings (retention period, backup window, etc). AWS Backup controls the same underlying RDS automated backups. This means you can restore using CloudFormation's standard PITR properties, just as you would with regular RDS automated backups.

Documentation:

Sharing a sample RDS Restore CloudFormation template (for testing only),

AWSTemplateFormatVersion: '2010-09-09'
Description: Restore RDS MySQL instance from continuous backup using PITR

Resources:
  RestoredDB:
    Type: AWS::RDS::DBInstance
    DeletionPolicy: Snapshot
    Properties:
      SourceDBInstanceIdentifier: rdsmysql
      UseLatestRestorableTime: true
      DBInstanceIdentifier: rdsmysql-restored
      DBInstanceClass: db.t4g.micro
      DBSubnetGroupName: default
      VPCSecurityGroups:
        - <sg-security-group>
      PubliclyAccessible: false
      MultiAZ: false
      StorageType: gp3
      CopyTagsToSnapshot: true

Outputs:
  RestoredDBEndpoint:
    Description: Endpoint of the restored DB instance
    Value: !GetAtt RestoredDB.Endpoint.Address
  RestoredDBPort:
    Description: Port of the restored DB instance
    Value: !GetAtt RestoredDB.Endpoint.Port

If AWS Backup just takes RDS snapshot backups then, those snapshots can also be restored. However, be advised that, DBSnapshotIdentifier and PITR properties (RestoreTime/UseLatestRestorableTime) are mutually exclusive cannot use both in the same CloudFormation template when restoring.

AWS
answered 2 months ago
EXPERT
reviewed 2 months ago
-1

Based on the available information about AWS Backup and RDS restoration, restoring an RDS instance from a backup vault using CloudFormation (CFT) is not directly supported through native AWS Backup restoration capabilities.

The standard restoration process for RDS instances from AWS Backup requires using either the AWS Backup console or AWS CLI. When you restore an RDS database from AWS Backup, you would typically select the backup from your backup vault and initiate the restore operation, which creates a new RDS instance.

For continuous backups with point-in-time recovery enabled through AWS Backup, the restoration process involves using the AWS Backup console or CLI with the appropriate restore parameters. The restore operation requires specific IAM permissions, including rds:RestoreDBInstanceToPointInTime for continuous backup restores.

If you need to automate RDS restoration as part of your infrastructure-as-code approach, you would likely need to use AWS CLI commands or AWS SDKs within your deployment process rather than directly through CloudFormation templates. Alternatively, you could explore using CloudFormation custom resources that invoke Lambda functions to trigger the AWS Backup restore operations programmatically.

For RDS Custom for SQL Server specifically, there's a workaround that involves using the snapshots created by AWS Backup (which appear with an 'awsbackup' prefix) and then using the restore-db-instance-from-db-snapshot operation, which could potentially be incorporated into automation workflows.
Sources
Point-in-time recovery and continuous backup for Amazon RDS with AWS Backup | AWS Storage Blog
Restore an Amazon RDS Custom for SQL Server instance using a backup from AWS Backup | AWS Database Blog
Continuous backups and point-in-time recovery (PITR) - AWS Backup

answered 3 months 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.