UPCOMING EVENT Discover how nOps streamlines your cost optimization at AWS re: Invent - BOOK A MEETING

NEW Featured eBook: AWS Cloud Cost Allocation: The Complete Guide - Download Now

Enable Point-in-Time recovery for RDS instance

The automated backup feature of Amazon RDS enables point-in-time recovery of your DB instance. When automated backups are turned on for your DB Instance, Amazon RDS automatically performs a full daily snapshot of your data (during your preferred backup window) and captures transaction logs (as updates to your DB Instance are made). When you initiate a point-in-time recovery, transaction logs are applied to the most appropriate daily backup in order to restore your DB instance to the specific time you requested.

This rule can help you with the following compliance standards:

Audit

To determine if your RDS database instances have Point-in-Time recovery enabled, perform the following:

1. Login to the AWS Management Console.

2. Navigate to RDS dashboard at https://console.aws.amazon.com/rds/.

3. In the navigation panel, under RDS Dashboard, click Instances.

4. Select the RDS instance that you want to examine.

5. Click the Maintenance and backups tab from the all tabs.

rds-article-2b

6. Under the Backup section, search for the Automated Backups statusIf the current status is set to Disabled, the RDS service will not perform point-in-time snapshots for the selected instance.

7. Repeat steps no. 4 – 6 for each RDS instance provisioned in the current region. Change the AWS region from the navigation bar to repeat the process for other regions.

1. Run describe-db-instances command (OSX/Linux/UNIX) to list all RDS database names, available in the selected AWS region:

aws rds describe-db-instances \ --region us-east-1 \ --query 'DBInstances[*].DBInstanceIdentifier'

 

2. The command output should return each database instance identifier:

[
    "database-1"
]

 

3. Run again describe-db-instances command (OSX/Linux/UNIX) using the RDS instance identifier returned earlier, to determine the retention period for the instance automated backups, e.g. the number of days for which RDS instance snapshots are retained:

aws rds describe-db-instances \\
--region us-east-1     \\
--db-instance-identifier **database-1**     \\
--query 'DBInstances[*].BackupRetentionPeriod'

 

4. The command output should return the retention period (number of days) for the selected RDS instance:

[
    0
]

If the current value for the retention period is set to 0 (zero), the Automated Backups feature is not enabled, meaning that AWS RDS will not perform point-in-time snapshots for the selected instance.

 

5. Repeat steps no. 1 – 4 for each RDS instance provisioned in the current region. Change the AWS region by using the --region filter to repeat the process for other regions

Remediation / Resolution

To update your RDS instance configuration and enable Multi-AZ deployment, perform the following:

1. Sign in to the AWS Management Console.

2. Navigate to the RDS dashboard at https://console.aws.amazon.com/rds/.

3. In the navigation panel, under RDS Dashboard, click DB Instances.

4. Select the RDS instance that you want to examine.

5. Click the Instance Actions button from the dashboard top menu and select Modify.

6. On the Modify DB Instance: <instance identifier> page, under the Additional configuration section, select a positive number (between 1 and 35) from the Backup Retention Period dropdown list. The value set represents the number of days for which instance automated backups are retained.

PIT-RDS-2

7. At the bottom of the page, click on continue, and on the next page, check to Apply Immediately to apply the changes immediately.

IMPORTANT: when you change the retention period from 0 to a non-zero value an immediate outage will occur so if the selected database instance is used in production consider leaving Apply Immediately option disabled before applying the changes in order to avoid any downtime. If Apply Immediately is not selected, the feature will be enabled during the next maintenance window.

8. Review the changes and click Modify DB Instance. Once the feature is enabled, the Automated Backups status should change to Enabled.RDS

and a new snapshot of the instance will be created.

9. Repeat steps no. 4 – 9 for each RDS instance available in the current region. Change the AWS region from the navigation bar to repeat the process for other regions.

1. Run describe-db-instances command (OSX/Linux/UNIX) to list all RDS database names, available in the selected AWS region.

aws rds describe-db-instances \\
	--region us-east-1 \\
	--query 'DBInstances[*].DBInstanceIdentifier'

2. The command output should return each database instance identifier.

[
    "database-1"
]

3. Run modify-db-instance command (OSX/Linux/UNIX) to modify the selected RDS instance configuration. The following command example enables Automatic Backups feature by setting the backup retention period (in days) for an RDS instance named database-1.

This example is using the –apply-immediately option to apply the change asynchronously and as soon as possible but note that using this parameter will trigger an immediate outage (to apply the change during the instance maintenance window, avoid adding the –apply-immediately command parameter).

aws rds modify-db-instance   \\
--region us-east-1  \\
--db-instance-identifier database-1 \\
--backup-retention-period 7    \\
--apply-immediately

4. The command output should reveal the new configuration metadata for the RDS instance.

PIT-RDS-instance

5. Run describe-db-instances command (OSX/Linux/UNIX) using the RDS instance identifier to check if the Automated Backups feature has been successfully enabled.

aws rds describe-db-instances \\
--region us-east-1 \\
--db-instance-identifier database-1 \\
--query 'DBInstances[*].BackupRetentionPeriod'

6. The command output should return the retention period (7 days in this case) for the selected RDS instance. If the feature was enabled a non-zero value should be returned.

[
    7
]

7. Repeat steps no. 1 – 6 for each RDS instance provisioned in the current region. Change the AWS region by using the –region filter to repeat the process for other regions.

Still Need Help?

Come see why we are the #1 cloud management platform and why companies like Uber, Dickey’s BBQ Pit and Norwegian Cruise Line trust nOps to manage their cloud.