Locking Down Production RDS Backups with AWS Backup Vault Lock
A hands-on runbook for locking production RDS backups with AWS Backup Vault Lock and cross-region copy, covering rollback limits and audit evidence.

In this lesson
Advertising disclosure: this article includes partner links. KBY may earn a commission if you sign up or buy through one, at no extra cost to you. How we make money.
Table of Contents
Table of contents
Before you begin
- AWS IAM permissions and role management
- AWS CLI configuration and usage
- RDS instance operations basics
Track this tutorial
Choose your current status and tick each safety check as you complete it. Sign in to sync progress between devices.
Current status
Tutorial stages
- Step 1: Create backup vaults with dedicated KMS keys in both regions
- Step 2: Build a backup plan with a cross-region copy action
- Step 3: Validate the service role and run a manual backup job
- Step 4: Apply Vault Lock, governance mode first
0 of 4 stages complete
Before you apply the change
Confirm these production-safety controls during the tutorial.
#Operational requirement
You are going to get handed a ticket that reads something like: “harden backupsThe KBY LexiconBackupA causally disconnected, point-in-time copy of system state, tagged with a consistency marker, that lets you recover from logical corruption or data loss independent of the source system's health.
against ransomware, DR audit next quarter.” Take it seriously. A previous incident that triggered this exact requirement involved a compromised IAM access key. The attacker deleted the production RDS instance, then walked through the AWS Backup console and deleted every recovery point in the vault, because the stolen role happened to carry backup:DeleteRecoveryPoint and backup:DeleteBackupVault. There was nothing left to restore from. That single fact is the reason this procedure exists.
AWS Backup Vault Lock stops the recovery points in a vault being deleted before their lifecycle completes, and makes new backup and copy jobs fail if their retention falls outside the allowed range. In governance mode, any principal allowed to call backup:DeleteBackupVaultLockConfiguration can still remove the lock, which is why that permission must be tightly restricted; once a compliance-mode lock’s grace period has ended, AWS documents that no one, including the root user and AWS itself, can change or delete the lock, and no principal can delete a recovery point in the vault before its lifecycle retention period completes. Combine it with cross-region copy and you also satisfy the availability requirement: a regional outage, or an attacker who only has access to one region, cannot destroy your only copy of production data. This is a realistic task for a newly hired administrator responsible for RDS resilience. It is also unforgiving. Get the lock mode wrong and there is no undo button.
Do not point this procedure at production on your first attempt. Build it against a throwaway vault first.
#Prerequisites and required permissions
You need an existing production RDS instance, a change management process that will genuinely approve an irreversible action, and the following permissions attached to your working role, ideally through a scoped permission set rather than administrator access: backup:CreateBackupVault, backup:CreateBackupPlan, backup:CreateBackupSelection, backup:StartBackupJob, backup:PutBackupVaultLockConfiguration, backup:DeleteBackupVaultLockConfiguration, kms:CreateKey, kms:CreateGrant, and iam:PassRole scoped to the AWS Backup service role. Deleting a lock configuration works on a governance-mode lock at any time, and on a compliance-mode lock only during its grace period. Scope the lock permissions to the named vault ARNs, restrict who holds them, and remove them once the change is closed, since they are exactly what an attacker would want.
You also need a second AWS region already reachable from the account, with no Organizations SCP blocking it, MFA enforced on the identity performing the lock operation, and a Change Advisory Board reference number written into the ticket before you start. Vault Lock in compliance mode is one of the few AWS actions where “we’ll fix it later” simply does not exist as an option. The approval trail matters more here than on almost any other change you will make this year.
#Step 1: Create backup vaults with dedicated KMS keys in both regions
Create a customer-managed KMS key per region rather than accepting the AWS managed backup key. You need explicit key policy control later for the cross-region copy step.
1PRIMARY_KEY_ARN=$(aws kms create-key --region us-east-1 --description "prod-rds-backup-primary" \
2 --query KeyMetadata.Arn --output text)
3aws backup create-backup-vault \
4 --backup-vault-name prod-rds-vault \
5 --encryption-key-arn "$PRIMARY_KEY_ARN" \
6 --region us-east-1
7
8SECONDARY_KEY_ARN=$(aws kms create-key --region us-west-2 --description "prod-rds-backup-secondary" \
9 --query KeyMetadata.Arn --output text)
10aws backup create-backup-vault \
11 --backup-vault-name prod-rds-vault-dr \
12 --encryption-key-arn "$SECONDARY_KEY_ARN" \
13 --region us-west-2Attach resources by tag, not by explicit ARN, so future RDS instances inherit protection automatically without a second change ticket:
1aws backup create-backup-selection \
2 --backup-plan-id <plan-id-from-previous-output> \
3 --backup-selection '{"SelectionName":"prod-rds-tagged","IamRoleArn":"arn:aws:iam::111122223333:role/AWSBackupDefaultServiceRole","ListOfTags":[{"ConditionType":"STRINGEQUALS","ConditionKey":"backup:tier","ConditionValue":"production-rds"}]}' \
4 --region us-east-1Expect a SelectionId returned with no error. Record the plan ID and selection ID in the ticket. Tag the RDS instance with backup:tier=production-rds before moving on, and well before the next scheduled start. AWS Backup does not document a fixed lead time, but a resource that does not match the selection when a scheduled run starts is simply not backed up in that run, and no failed job is recorded for it.
#Step 3: Validate the service role and run a manual backup job
Confirm the AWS Backup service role carries both managed policies, not just one:
aws iam list-attached-role-policies --role-name AWSBackupDefaultServiceRoleYou need AWSBackupServiceRolePolicyForBackup for the backup jobs themselves and AWSBackupServiceRolePolicyForRestores for the restore test in Verification. Force a manual run instead of waiting on the cron schedule:
1aws backup start-backup-job \
2 --backup-vault-name prod-rds-vault \
3 --resource-arn arn:aws:rds:us-east-1:111122223333:db:prod-orders-db \
4 --iam-role-arn arn:aws:iam::111122223333:role/AWSBackupDefaultServiceRole \
5 --lifecycle DeleteAfterDays=100 \
6 --region us-east-1Give the on-demand job the plan's 100-day lifecycle. Without --lifecycle its recovery point is kept indefinitely, outside the 35 to 100 day range you lock in Step 4, and AWS documents that once a lock is in place, backup and copy jobs that do not conform to its retention range fail. Poll aws backup describe-backup-job --backup-job-id <id> until State reads COMPLETED and note its RecoveryPointArn. An on-demand job does not run the plan's copy actions, so test the cross-region copy explicitly:
1aws backup start-copy-job \
2 --recovery-point-arn <recovery-point-arn-from-describe-backup-job> \
3 --source-backup-vault-name prod-rds-vault \
4 --destination-backup-vault-arn arn:aws:backup:us-west-2:111122223333:backup-vault:prod-rds-vault-dr \
5 --iam-role-arn arn:aws:iam::111122223333:role/AWSBackupDefaultServiceRole \
6 --lifecycle DeleteAfterDays=100 \
7 --region us-east-1Then confirm it with aws backup list-copy-jobs --by-state COMPLETED --region us-east-1, showing a DestinationRecoveryPointArn in us-west-2. If the copy job sits in RUNNING past the completion window, or fails on an access-denied condition, stop. Fix the destination KMS key policy before you go anywhere near Vault Lock.
#Step 4: Apply Vault Lock, governance mode first
| Mode | Can be removed? | When to use it |
|---|---|---|
Governance (no --changeable-for-days) | Yes, by an authorised principal, at any time | Testing, initial rollout, staging environments |
| Compliance (within grace period) | Yes, by an authorised principal, until the grace period ends | Only after Verification passes and CAB approves; it starts an irreversible commitment that becomes permanent when the grace period ends |
| Compliance (after grace period expires) | No, not by anyone, including root | Final production state once tested and CAB-approved |
Vault Lock uses a single configuration call. Omitting --changeable-for-days creates a governance-mode lock that suitably authorised principals can change or remove at any time. Supplying it (minimum 3 days) creates a compliance-mode lock: during that grace period an authorised principal can still remove it, and once the grace period elapses the lock becomes permanent. There is no warning prompt for this transition. Before running the command, confirm that every lifecycle in the plan, copy action included, falls between the minimum and maximum retention you set (here 100 days sits inside 35 to 100), because that range is fixed once the lock becomes immutable. The lock covers only this vault; repeat it for prod-rds-vault-dr in us-west-2 if the DR copies must also be immutable.
1# 1. Governance mode: removable by an authorised principal
2aws backup put-backup-vault-lock-configuration \
3 --backup-vault-name prod-rds-vault \
4 --min-retention-days 35 \
5 --max-retention-days 100 \
6 --region us-east-1
7
8# 2. Compliance mode: only after Verification passes and CAB approves.
9# Becomes permanent when the 3-day grace period ends.
10aws backup put-backup-vault-lock-configuration \
11 --backup-vault-name prod-rds-vault \
12 --min-retention-days 35 \
13 --max-retention-days 100 \
14 --changeable-for-days 3 \
15 --region us-east-1Run the first command, complete Verification under the governance lock, and run the second only once CAB has approved. After each, expect no error and, in the next describe-backup-vault call, Locked with the retention values; for the compliance lock, LockDate shows when the grace period ends. Capture the describe output with a timestamp and put it and that date in the ticket. If anything is still unresolved as that date nears, delete the lock configuration while the grace period is still running (see Rollback) and apply a new compliance lock only after it is resolved and CAB has approved again. Once the grace period ends the lock cannot be deleted, so never let it lapse mid-test.
#Verification
Before closing the change ticket, run all of the following and attach the outputs:

1aws backup describe-backup-vault --backup-vault-name prod-rds-vault --region us-east-1
2aws backup list-backup-jobs --by-resource-arn arn:aws:rds:us-east-1:111122223333:db:prod-orders-db
3aws backup list-copy-jobs --by-state COMPLETED --region us-east-1Then perform an actual restore into an isolated non-production VPC. Never into the production subnet. Record the restored instance identifier and the restoration duration. This is the real completion check. If you cannot produce a working restored database from a locked recovery point, the control does not meet the requirement yet, no matter what the console shows.
#Common Traps
| Symptom | Likely cause | Fix |
|---|---|---|
| Copy job fails on an access-denied condition against the destination key | Destination region KMS key policy does not let the IAM role that runs the copy job use the key | Restore the statement that delegates key access to IAM policies in the account, or add one for the AWS Backup service role, following the AWS Backup encryption documentation |
| Restore test fails on an access-denied condition | AWSBackupServiceRolePolicyForRestores is not attached | Attach the managed policy and retry the restore |
| First scheduled job silently excludes the RDS instance | Tag missing or mistyped when the scheduled run started, so no job was created for it | Correct the tag, wait for the next scheduled run, confirm via list-backup-jobs |
| Backup or copy job fails after the lock is applied | The job’s lifecycle retention falls outside the lock’s MinRetentionDays to MaxRetentionDays range | Set the plan or job lifecycle within the range; the range itself can be changed only before a compliance lock’s grace time ends |
| Vault becomes immutable earlier than planned | Grace period expired before testing finished | None available. This is exactly what Rollback below covers |
#Rollback
If you are still inside the grace period, rollback is straightforward:
1aws backup delete-backup-vault-lock-configuration \
2 --backup-vault-name prod-rds-vault \
3 --region us-east-1Confirm with describe-backup-vault that the lock configuration block is gone. To remove the cross-region copy action without touching the lock, edit the plan JSONThe KBY LexiconJSONJSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format built from key-value pairs and ordered lists, defined by RFC 8259.
to drop the CopyActions array and run aws backup update-backup-plan with the revised document. To decommission the plan while keeping recovery points intact, delete the backup selection first, then the plan. The vault and its stored recovery points are unaffected by plan deletion.
If the grace period has already expired and the vault has converted to compliance mode, say so plainly to your manager rather than trying to work around it quietly. There is no API rollback at that point. Recovery points are removed only when each one’s own lifecycle retention period completes. AWS documents that a compliance-mode lock, once its grace period has ended, cannot be changed or deleted by any user or by AWS, so there is no support route around it either. This is exactly why the grace period exists, and exactly why you test in governance mode against a disposable vault before ever pointing this procedure at production.
#Operational Summary
The deliverable for this task is a locked, cross-region-replicated backup vault protecting a named production RDS instance, backed by documented evidence: the vault ARNs and encryption key ARNs, the backup plan and selection IDs, at least one completed backup job and one completed cross-region copy job, the lock configuration output with its grace period expiry date, and a successful restore into an isolated non-production environment with a recorded duration. File all of it against the CAB ticket number before you close the change.
Vault Lock is one of the few controls in AWS where the safe default is deliberate slowness. Test in governance mode first. Prove the restore actually works. Get sign-off from your change board. Only then let the grace period run out into compliance mode. Treat the irreversibility as the feature it is meant to be, not as a risk you talked yourself into, and only after you have personally verified the restore path end to end.
#Learning Objectives
By the end of working through this procedure, you should be able to distinguish governance mode from compliance mode in practical terms, not just definitionally: you should be able to state, from your own testing, exactly what breaks and what does not when a lock configuration is deleted versus when the grace period has already lapsed.
You should also be able to explain the cross-region copy dependency chain: source vault key, destination vault key, the AWS Backup service role, and the specific KMS actions each side needs, because a gap anywhere in that chain produces the access-denied failure mode described in the Common Traps table, and diagnosing it quickly depends on understanding the chain rather than pattern-matching the error text.
A further objective is being able to produce audit-ready evidence without being told what to collect each time: vault ARNs, key ARNs, plan and selection IDs, job IDs in both COMPLETED and RUNNING states, and a restore duration, assembled as a matter of habit rather than as a checklist read off a ticket template.
- Differentiate governance-mode and compliance-mode behaviour through direct testing rather than documentation alone
- Trace the KMS permission chain required for a cross-region backup copy to succeed
- Assemble CAB-ready evidence for a locked, replicated backup configuration without prompting
#Worked Example
The article instructs you to fix the destination KMS key policy when a copy job fails on access-denied, without showing the policy statement itself. In practice, the destination key policy must let the IAM role that runs the copy job (the role passed to the job, here AWSBackupDefaultServiceRole) use the key, for actions such as kms:CreateGrant, kms:DescribeKey, kms:Decrypt and kms:GenerateDataKey. A key created with aws kms create-key and no –policy gets the default key policy, whose statement for the account delegates access to IAM policies, so access then depends on the policies attached to that role; a key policy that has dropped or replaced that statement is one common cause of the access-denied failure. Take any statement you add from the key policy examples in AWS Backup's encryption documentation, scoped to that role, rather than adding conditions the documentation does not show.
Before editing the key policy, retrieve and save the existing document with aws kms get-key-policy –key-id $SECONDARY_KEY_ARN (the key ARN captured in Step 1) –policy-name default –region us-west-2, redirecting the output to a local file. This is your rollback artefact. Keep the existing statements that give the account and your key administrators access; a key policy that drops them can leave the key unmanageable until AWS Support intervenes. Only after that file exists should you apply the revised policy with aws kms put-key-policy –key-id $SECONDARY_KEY_ARN –policy-name default –policy file://revised-policy.json –region us-west-2.
Validate by re-running the failed copy job manually rather than waiting for the next scheduled window: aws backup start-copy-job with the same source recovery point ARN and destination vault ARN used previously. Poll aws backup describe-copy-job until State reads COMPLETED. If it still fails, the fault is elsewhere in the chain, most likely the service role's managed policies checked in Step 3, not the key policy.
Rollback, if the new policy statement causes an unrelated permission regression elsewhere, is to reapply the saved original document with the same put-key-policy call, then re-validate with get-key-policy that the reverted JSON matches the saved file byte for byte before considering the rollback complete.
#Practice Exercise
Using a disposable, non-production vault only, build a monitoring layer the base procedure does not include: an EventBridge rule matching AWS Backup job state changes, filtered to the states FAILED, ABORTED and EXPIRED, with an SNS topic as the target. This alerts on jobs that fail; it cannot catch a resource that was not tagged in time, because no job is created for it, so check that separately with list-backup-jobs as in the Common Traps table.
Create the SNS topic first, subscribe your own email address, and confirm the subscription before wiring anything else, since an unconfirmed subscription will silently drop notifications in exactly the same way the article warns about elsewhere. Then create the EventBridge rule with an event pattern matching source aws.backup and detail-type Backup Job State Change, targeting the SNS topic ARN.
Validate by manually triggering a failure condition in your disposable environment only, such as starting a manual backup job of a disposable resource with a disposable IAM role whose permissions you have removed, and confirming the SNS notification arrives within a few minutes. Then restore the correct role and confirm the next manual job succeeds without alerting.
Rollback is deleting the EventBridge rule, deleting the SNS subscription and topic, and confirming with aws events list-rules and aws sns list-topics that neither resource remains, before discarding the disposable vault itself with aws backup delete-backup-vault once it holds no recovery points.
#Related reading
AWS Site-to-Site VPN Tunnel Down After BGP Flap to Azure: Fix
Testing and Verifying AWS RDS Multi-AZ Failover in Production
AWS Identity Controls Leave Workloads Exposed Until Verified
An AWS Principal Field Left as an Account ARN Silently Grants Every Role in That Account
Evidence trail
Sources and verification
Primary documentation and external technical references used in this article.
About this page
Credited to
Dates
Published
Read-only scripts
- Windows devices with no BitLocker recovery key in Entra IDMicrosoft Entra ID, Windows
- Intune devices that haven't synced in N daysMicrosoft Intune
- Mailboxes forwarding to external addressesExchange Online
- BitLocker status of every volume on this PCWindows
Upcoming deadlines
- Intune moves to macOS 15 and laterQ4 2026
- SAP SuccessFactors provisioning: move from basic auth to workload identityNovember 2026
- Intune November release: JIT registration reminder at APNs renewal and automatic JIT for eligible tenantsNovember 2026
Explore KBY
The KBY Brief
A short email about twice a week with new runbooks, configuration traps and fixes from KBY Technologies.
SubscribeRelated articles
Cloud Infrastructure and Operations
Enforcing AWS Auto Scaling Health Checks for Resilient EC2
A hands-on runbook for converting EC2-only Auto Scaling health checks to ELB-aware checks, with tuning, failover proof, evidence and rollback steps.
Enterprise IT Management
Bounded Enterprise IT Management Operations in Microsoft 365
A method for one bounded Microsoft 365 change: scope, baseline, pilot, observation and rollback, with evidence defined before action.
DevOps & Automation
Installing Argo CD with Helm: Production Values, HA, Upgrades and Rollback
A production-focused guide to installing Argo CD with Helm, covering pinned values, high availability, validation, security, upgrades and rollback.
Discover more
Graduate Learning
Lexicon Definitions
Learn More About KBY
About KBY
Learn about our mission, how our content is produced, and how we handle corrections.
Why Trust KBY
How KBY content is produced, what is checked automatically, and how errors are corrected.
The KBY Brief
A short email about twice a week with new runbooks, configuration traps and fixes from KBY Technologies.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Build practical engineering skills.
Receive new lessons, learning paths, practical exercises and early-career guidance.
Comments
Add a thoughtful note on Locking Down Production RDS Backups with AWS Backup Vault Lock. Comments are checked for spam and held for moderation before appearing.