How to test backup restore with AWS Backup restore testing

Learn how AWS Backup restore testing works: build a restore testing plan, pick recovery points, schedule tests, validate restores and review results.

10 min read2 viewsHow to test backup restore with AWS Backup restore testing
— · 0 votes
Contents
  1. What AWS Backup restore testing does
  2. What you need before creating a plan
  3. Scheduling restore tests and choosing recovery points
  4. Assigning resources with restore testing selections
  5. Validating restored resources with your own checks
  6. Running restore tests from the AWS CLI
  7. Reviewing test results and restore costs
  8. Keeping test restores isolated from production
  9. AWS Backup restore testing questions
  10. How often should AWS Backup restore tests run?
  11. Does AWS Backup restore testing delete the restored resources?
  12. Is validation required for an AWS Backup restore test?
  13. Can a restore testing plan use recovery points from any backup vault?
  14. What happens when an AWS Backup restore test fails?

AWS Backup restore testing checks your backups by restoring recovery points on a schedule you set. You create a restore testing plan, assign protected resources, and optionally validate each restored resource. AWS Backup then deletes the test resources after the window you choose.

  • A restore testing plan sets the schedule, start window and which recovery points get restored.
  • Each resource selection covers one resource type, chosen by ARN or by tags.
  • Restore metadata overrides keep test copies off production subnets, names and security groups.
  • Validation code reports a result through the PutRestoreValidationResult API before the window closes.
  • Restore job history shows whether each scheduled test restore succeeded or failed.

What AWS Backup restore testing does

AWS Backup restore testing is a managed feature that restores your backups automatically on a schedule. A backup that has never been restored is an untested assumption, not proof of recovery. The feature turns periodic restore checks into a repeatable job instead of a manual drill. Each run creates real resources from a recovery point, then removes them afterward.

A recovery point is a single backup copy of a resource stored in a backup vault. A backup vault is the container where AWS Backup keeps those recovery points. Restore testing reads from the vaults you choose and picks recovery points that match your criteria. The restored copy behaves like any restore you would start by hand.

Restore testing answers two questions that a backup report alone cannot answer. The first is whether the recovery point restores without errors. The second is whether the restored data actually works for your application. Restore job status covers the first question, while validation code covers the second.

What you need before creating a plan

Restore testing needs existing recovery points in at least one backup vault before any test can run. Backup plans or on-demand backups create those recovery points for each protected resource. A protected resource is any resource that AWS Backup has backed up at least once. Without recovery points inside the selection window, a scheduled test has nothing to restore.

An IAM role gives AWS Backup permission to perform restores and create the test resources. IAM stands for Identity and Access Management, the AWS service that controls permissions. The console can create a default service role, or you can supply a custom role. A custom role must allow restores for every resource type your selections include.

Supported resource types for restore testing include Amazon EBS volumes, EC2 instances, RDS databases and EFS file systems. Amazon DynamoDB tables, Amazon S3 data and several Amazon FSx file systems are covered as well. The list of supported types changes as AWS adds services, so check the current documentation. Encrypted recovery points also need encryption key permissions so the role can decrypt them.

Scheduling restore tests and choosing recovery points

A restore testing plan defines when tests run and which recovery points they draw from. You set the frequency as daily, weekly, monthly or a custom cron expression. A cron expression is a scheduling string that names minutes, hours, days and months. The start window gives AWS Backup a span of hours in which to begin each test.

Recovery point selection criteria tell the plan which vaults and backup types to consider. You can include all vaults in the account or name specific vaults by Amazon Resource Name. Eligible types are snapshot backups, continuous backups or both, depending on the resource. A selection window in days limits tests to recovery points created recently.

The selection algorithm decides which recovery point inside the window each test restores. Latest within window always picks the newest eligible recovery point. Random within window picks any eligible recovery point, which also exercises older backups. Random selection gives a broader picture of backup health over time.

SettingWhat it controls
ScheduleHow often a test runs, from daily to a custom cron expression
Start windowThe span of hours in which a test may begin
Vault selectionAll vaults or named backup vaults the plan reads from
Recovery point typesSnapshot backups, continuous backups or both
Selection windowHow many days back an eligible recovery point can be
AlgorithmLatest within window or random within window

Assigning resources with restore testing selections

A restore testing selection assigns protected resources of one type to a restore testing plan. Each selection covers a single resource type, such as EBS volumes or RDS databases. A plan can hold several selections, one for each type you want to test. You can pick resources by ARN, by tags or include all resources of that type.

Tag-based conditions let new resources join a test automatically once they carry the matching tag. Conditions can require a tag value to equal or not equal a value you name. Tagging production databases with a restore test label keeps the selection current without manual edits. Selecting by ARN suits a small, fixed set of critical resources.

Restore metadata overrides change settings on the test copy so it does not collide with production. Typical overrides include a separate subnet, security group, instance type or database identifier. AWS Backup can infer default metadata from the recovery point, and you edit only what differs. Overrides that place restores in an isolated network reduce the chance of affecting live traffic.

Validating restored resources with your own checks

Restore validation confirms that a restored resource actually works, not just that the restore finished. AWS Backup sends an event to Amazon EventBridge when a restore test job completes. An EventBridge rule can trigger an AWS Lambda function that runs your checks against the restored resource. Checks might open a database connection, read a known file or count table rows.

Validation code reports its outcome by calling the PutRestoreValidationResult API with a status. The status marks the test as successful or failed, with an optional message explaining why. The validation status appears on the restore job, next to the restore result itself. Clear status messages make failed tests easier to diagnose later.

The validation window sets how many hours the restored resource stays available for checks. AWS Backup deletes the test resource when validation reports a result or the window ends. A window that is too short can cut off slow checks on large databases. The right length depends on how long restore and validation take for each resource type.

Running restore tests from the AWS CLI

The AWS CLI manages restore testing through commands under the aws backup namespace. CLI stands for command line interface, a tool that calls AWS APIs from a terminal. Plans and selections are created in separate steps, each with its own command. Each command takes JSON input that mirrors the fields in the console.

Creating a plan starts with create-restore-testing-plan and a JSON body describing the schedule. The body holds the plan name, cron expression, start window and recovery point selection. Next, create-restore-testing-selection attaches a resource type, IAM role and resource conditions. Running get-restore-testing-inferred-metadata on a recovery point shows the default restore settings AWS Backup would use.

Results from scheduled tests can be checked with list-restore-jobs filtered by the restore testing plan ARN. Validation code running outside Lambda can still report through put-restore-validation-result. Plans are changed with update-restore-testing-plan and removed with delete-restore-testing-plan. Selections must be deleted before their parent plan can be deleted.

  • create-restore-testing-plan sets the schedule and recovery point criteria
  • create-restore-testing-selection assigns resources of one type to a plan
  • list-restore-testing-plans shows the plans in the current account and Region
  • get-restore-testing-inferred-metadata shows default restore settings for a recovery point
  • put-restore-validation-result reports the outcome of your checks
  • list-restore-jobs shows past test restores and their status
  • delete-restore-testing-selection removes a selection before plan deletion

Reviewing test results and restore costs

Restore job history in the AWS Backup console shows each test restore with its status and timing. Jobs created by restore testing link back to the plan that started them. A failed restore job points to a problem with the recovery point, permissions or metadata. A failed validation points to a problem with the data or the application itself.

AWS Backup emits events for restore jobs, which can feed alerts through EventBridge and Amazon SNS. SNS, or Simple Notification Service, delivers messages to email, chat tools or other endpoints. Alerts on failed tests turn silent backup problems into tasks someone can fix. Saved job records also give auditors evidence that restores were tested on schedule.

Restore testing costs depend on the number of test restores and the resources they create. Charges can include a fee per restore test plus normal charges for the restored resources while they exist. Large databases or file systems cost more to restore, and they run longer during validation. Shorter validation windows and targeted selections keep test spending in proportion to the risk.

Keeping test restores isolated from production

Test restores create real, running resources that can interact with live systems if left unguarded. A restored EC2 instance might start scheduled jobs, send email or write to shared storage. A restored database copy might accept connections meant for production if names or endpoints overlap. Isolation through overrides and network rules helps keep these copies from acting like the originals.

A dedicated test subnet with restrictive security groups keeps restored resources away from production traffic. Security groups are virtual firewalls that control which connections reach a resource. Outbound access deserves the same attention, since restored applications may try to call external services. Network design for a regulated workload is a job for a qualified cloud or security engineer.

Restored data holds the same sensitive information as the original, so access to test copies needs care. The IAM role used for testing should have only the permissions restore and cleanup require. Validation functions should read data without exporting it or writing copies elsewhere. Reviewing permissions whenever you add a resource type keeps the setup tight over time.

AWS Backup restore testing questions

How often should AWS Backup restore tests run?

There is no single correct frequency for AWS Backup restore tests. The schedule depends on how critical the resource is, how often it changes and your recovery requirements. Frequent tests catch problems sooner but add restore costs for each run.

Does AWS Backup restore testing delete the restored resources?

Yes, AWS Backup deletes resources created by restore testing after validation reports a result or the validation window ends. You do not need to remove those test copies by hand. Resources your validation code creates separately, such as extra snapshots, fall outside that cleanup.

Is validation required for an AWS Backup restore test?

No, validation is optional in AWS Backup restore testing. Without validation, a test confirms only that the restore job completed. Adding validation code confirms that the restored data is usable by your application.

Can a restore testing plan use recovery points from any backup vault?

Yes, a restore testing plan can draw from all backup vaults in the account or from vaults you name. The recovery points must still match the resource type, backup type and selection window in the plan. Encrypted recovery points also need key permissions for the restore role.

What happens when an AWS Backup restore test fails?

A failed restore test shows a failed status on the restore job in AWS Backup. The job details include a status message describing the cause, such as missing permissions or invalid metadata. An EventBridge rule can send an alert so someone reviews the failure promptly.

Read next

Latest articles