Skip to main content

Triage and Remediation

Remediation

Using Console

Below are the exact AWS Console steps to integrate AWS Backup with Amazon RDS and remediate the finding “Amazon Backup Should Be Integrated with Amazon RDS”.

1. Turn on AWS Backup for Amazon RDS (Service opt-in)

  1. Sign in to the AWS Management Console.
  2. Go to AWS Backup:
    Services → search for “Backup” → open AWS Backup.
  3. In the left menu, select Settings.
  4. Under Service opt-in, find Amazon RDS.
  5. For the Region where your RDS runs, set Amazon RDS to Enabled.
  6. Click Confirm or Save if prompted.

2. Create (or choose) a Backup Vault

  1. In AWS Backup, in the left menu click Backup vaults.
  2. Click Create backup vault (skip if you already have one to use).
  3. Enter:
    • Backup vault name (e.g., rds-backup-vault).
    • Optionally choose a KMS key for encryption.
  4. Click Create backup vault.

3. Create a Backup Plan That Includes RDS

  1. In AWS Backup, click Backup plans in the left menu.
  2. Click Create backup plan.
  3. Choose Build a new plan.
  4. Fill in:
    • Backup plan name (e.g., rds-daily-backup-plan).
  5. Under Backup rule configuration:
    • Rule name: e.g., rds-daily-backup.
    • Backup vault: select the vault you created (e.g., rds-backup-vault).
    • Backup frequency: e.g., Daily.
    • Backup window: leave default or customize.
    • Lifecycle: set Transition to cold storage and Expire as per your policy.
  6. Click Create plan.

4. Assign RDS Resources to the Backup Plan

  1. After the plan is created, open it from Backup plans.
  2. Click Assign resources.
  3. Configure:
    • Resource assignment name: e.g., rds-production-assignment.
    • IAM role:
      • Use Default role (AWSBackupDefaultServiceRole) if it exists, or
      • Let AWS Backup create a new role when prompted.
  4. Under Assign resources:
    • Resource type: choose Amazon RDS (or leave as Include all resource types and filter by tag).
    • Choose one of:
      • Include specific resources → select your RDS DB instances or clusters from the list
        OR
      • Assign by tag → specify tag key/value used on your RDS instances (e.g., Backup = True).
  5. Click Assign resources.

5. Verify Backups Are Working

  1. Wait until the first scheduled backup window passes (or trigger an on‑demand backup).
  2. To test on-demand:
    • Go to Protected resources in AWS Backup.
    • Select your RDS resource (if visible), or:
      • Go to Backup jobsCreate on‑demand backup.
      • Choose Resource type: Amazon RDS, then pick the specific RDS instance or cluster.
      • Choose the Backup vault and click Create on‑demand backup.
  3. Confirm a job appears under Backup jobs and completes with Status: Completed.
  4. Go to Protected resources and confirm your RDS instance shows recovery points.

Once RDS is opted in to AWS Backup and your RDS instances are assigned to a backup plan with successful recovery points, the “Amazon Backup Should Be Integrated with Amazon RDS” finding will be remediated.
Below are the core steps and CLI commands to integrate Amazon RDS with AWS Backup.Assumptions:
  • You have aws CLI configured with permissions for AWS Backup and RDS.
  • Replace placeholders like <REGION>, <ACCOUNT_ID>, <VAULT_NAME>, etc.

1. Opt in RDS as a protected resource in AWS Backup

Verify:
Check that "RDS": true under ResourceTypeOptInPreference.

2. Create a Backup Vault (if you don’t already have one)

If you want the default AWS Backup KMS key, you can omit --encryption-key-arn.

3. Create a Backup Plan

Example: daily backups retained for 35 days.
Note the BackupPlanId from the response.

4. Create/Use an IAM Role for AWS Backup

If you don’t already have the required role, create one with the AWS managed policy AWSBackupServiceRolePolicyForBackup.Trust policy (example file trust-policy.json):
Create the role:
Attach the managed policy:
Use the role ARN in the next step: arn:aws:iam::<ACCOUNT_ID>:role/AWSBackupDefaultServiceRole

5. Assign RDS Databases to the Backup Plan

You can target RDS instances by ARN or by tag.

Option A – Select specific RDS instances by ARN

Get your RDS instance ARN(s):
Create a backup selection:

Option B – Use tags to select RDS instances

Tag your RDS instances:
Create tag-based selection:

6. Verify Backups

List backup jobs:
Filter for ResourceType = RDS and confirm jobs complete successfully.This completes integrating Amazon RDS with AWS Backup using the CLI.
Below is a concise, step‑by‑step way (with Python/boto3 code) to integrate Amazon RDS with AWS Backup. The focus is: create a backup plan, ensure required IAM role, and assign RDS resources to that plan.

1. Prerequisites

  1. An RDS instance exists.
  2. You have:
    • boto3 installed
    • AWS credentials configured with permissions for:
      • backup:*
      • rds:DescribeDBInstances
      • iam:CreateRole, iam:AttachRolePolicy (or an existing service role for AWS Backup)

2. Create/Verify the AWS Backup IAM Role (AWSBackupDefaultServiceRole)

AWS Backup usually uses AWSBackupDefaultServiceRole. If it doesn’t exist, create it.

3. Identify Your RDS Instance

You need the DB instance ARN.

4. Create an AWS Backup Plan (if you don’t already have one)

Example: daily backup, 35‑day retention.
If you already have a plan, you can just capture its BackupPlanId instead of creating a new one.

5. Assign the RDS Instance to the Backup Plan

You can assign by:
  • Direct ARN, or
  • Tags
Here we assign by resource ARN.

6. (Optional) Start an On‑Demand Backup Job for the RDS Instance

To verify integration, you can run an on‑demand backup:

Summary

To remediate “Amazon Backup Should Be Integrated with Amazon RDS” via Python:
  1. Ensure AWSBackupDefaultServiceRole exists and has the right policy.
  2. Get your RDS instance ARN.
  3. Create (or choose) an AWS Backup plan with schedule/retention.
  4. Create a backup selection that includes the RDS ARN and uses the backup role.
  5. Optionally run an on‑demand backup to confirm.
You can bundle these snippets into a single script and parameterize RDS instance ID, account ID, schedule, and retention as needed.
This configuration creates an AWS Backup vault and plan, then integrates the RDS instance with that plan via aws_backup_selection (no resource replacement of the RDS instance is required).On terraform plan you should see creation of aws_backup_vault.rds_vault, aws_backup_plan.rds_plan, and aws_backup_selection.rds_selection, with no destructive changes to existing RDS resources.