Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To fix “Backup Retention Duration Should Be Present” for an AWS RDS instance via the AWS Console, you need to enable/adjust Automated Backups (Backup retention period > 0).
For an existing RDS DB instance
- Sign in to the AWS Management Console and go to RDS.
- In the left menu, click Databases.
- Select the DB instance you want to fix.
- Click Modify (top right).
- Scroll to the Additional configuration (or Backup) section:
- Find Backup retention period.
- Set it to a value between 1 and 35 days (e.g., 7).
- Optionally adjust Backup window if you want a specific time.
- Scroll down and click Continue.
- Under Scheduling of modifications, choose:
- Apply immediately (for instant change), or
- During the next maintenance window (safer for production).
- Click Modify DB instance to save.
For a new RDS DB instance
- In RDS Console → Databases → Create database.
- Choose engine and template as usual.
- In Additional configuration / Backup section:
- Set Backup retention period to ≥ 1 day.
- Configure backup window if desired.
- Complete other settings and click Create database.
Using CLI
Using CLI
For Amazon RDS, “Backup Retention Duration Should Be Present” means the automated backup retention period must be set to a non-zero value (for Aurora: set on the cluster; for non-Aurora: on the instance).Below are step‑by‑step AWS CLI instructions.
This lists RDS instances that have automated backups disabled.
In the examples below, I’ll use
Key flags:
For a specific Aurora cluster:Once
1. Identify RDS Instances with Backup Retention = 0
2. Decide Your Desired Retention Period
Choose a value between 1 and 35 (days), according to your policy (e.g., 7 or 30 days).In the examples below, I’ll use
7.3. Remediate Non-Aurora RDS Instances
Replacemy-db-instance-id and 7 with your values.--backup-retention-period 7→ enables automated backups, keeps 7 days--apply-immediately→ apply change right away (omit if you prefer next maintenance window)
BackupRetentionPeriod == 0.4. Remediate Aurora Clusters (if using Aurora)
For Aurora, retention is configured at the cluster level.4.1. Find Aurora clusters with retention = 0
4.2. Set retention on each cluster
5. Verify the Change
For a specific instance:BackupRetentionPeriod is greater than 0, the misconfiguration is remediated.Using Python
Using Python
For AWS RDS, “Backup Retention Duration Should Be Present” means
BackupRetentionPeriod must be > 0 (automated backups enabled). Below is how to remediate it using Python (boto3).1. Prerequisites
- Install and configure AWS CLI or set env vars so boto3 has credentials:
- Ensure your IAM role/user has:
rds:DescribeDBInstancesrds:ModifyDBInstance
2. Identify RDS instances with no backup retention
3. Remediate: set a proper backup retention period
Pick a standard (e.g., 7 days). Adjust based on your policy.4. Verify remediation
5. Notes
- For Aurora clusters, use
modify_db_clusterwithBackupRetentionPeriodinstead: BackupRetentionPeriodvalid range is typically1–35(check the engine/region docs if needed).
Using Terraform
Using Terraform
backup_retention_period is an in‑place modification and does not force replacement of the DB instance or cluster.After you add or change this argument, terraform plan should show an in-place update with a change like:backup_retention_period: "0" => "7"

