Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

AWS Backup Restore Tests: EC2 & Aurora Guide

· 7 min read · Home Tech

In this article
  1. Why Restore Tests Matter
  2. How AWS Backup Restore Works for EC2
  3. How AWS Backup Restore Works for Aurora
  4. Step-by-Step: Manual Restore Test
  5. Automating Restore Tests
  6. Using the Restore Testing Plan (AWS Backup)
  7. Common Problems and How to Avoid Them
  8. Cost Considerations
  9. Frequently Asked Questions

This guide explains how to perform and automate AWS Backup restore tests for EC2 instances and Aurora clusters, covering the practical steps, automation options, and common pitfalls. You will learn what restore testing actually involves, how to validate your backups, and how to turn a manual recovery drill into a repeatable process.

Why Restore Tests Matter

AWS Backup is a managed service that centralizes backup policies across EC2, RDS, Aurora, EFS, DynamoDB, and other resources. But a backup that has never been restored is just a guess. Restore tests verify that your backup data is intact, that the restore process works, and that the resulting resource actually comes up and serves traffic. They also satisfy compliance requirements such as SOC 2, HIPAA, and ISO 27001, which often mandate periodic recovery testing.

Many teams only test restores after a disaster, only to discover that the backup was misconfigured, the IAM role lacked permissions, or the restore produced an unusable instance. A scheduled restore test catches these issues before they become an outage.

How AWS Backup Restore Works for EC2

When you restore an EC2 instance from an AWS Backup recovery point, the service creates a new Amazon EBS volume from the snapshot and launches a new instance using the original instance's launch configuration. The restore operation does not overwrite the original instance; it always creates a new one. You can choose a different instance type, VPC, subnet, security group, or IAM role during the restore.

Restoring an EC2 instance typically takes a few minutes, depending on the size of the underlying EBS volumes. During the restore, AWS Backup creates a new volume from the snapshot, attaches it to the new instance, and then applies any overrides you specified. The instance is launched with the same AMI as the original, but note that if the original instance was launched from an AMI that has since been deregistered, the restore may fail.

How AWS Backup Restore Works for Aurora

Aurora backups are continuous and point-in-time recoverable. AWS Backup creates snapshots of the entire cluster, including all writer and reader instances. When you restore an Aurora cluster from a backup, AWS Backup creates a new cluster with the same engine version, parameter group, VPC, and security groups as the original, unless you override them.

You can restore to a specific point in time, but AWS Backup's restore interface only allows you to select a recovery point (a snapshot). To do a point-in-time restore, you must use the Aurora console or the RDS API directly, not AWS Backup. Restoring a cluster usually takes 10–20 minutes because Aurora provisions new storage and replays the database logs.

Step-by-Step: Manual Restore Test

Follow these steps to perform a manual restore test for an EC2 instance:

  1. Open the AWS Backup console and navigate to Protected resources.
  2. Select the EC2 instance you want to test and click Recovery points.
  3. Choose the recovery point you want to test (usually the most recent) and click Restore.
  4. In the restore configuration, choose the instance type, VPC, subnet, and security group. For a test, it is wise to use a separate test VPC or at least a different subnet.
  5. Click Restore backup. The restore job appears in the Jobs section.
  6. Once the job shows Completed, go to the EC2 console and verify the new instance is running.
  7. Connect to the instance (SSH or RDP) and verify that the data is present and the application works.
  8. Terminate the test instance to avoid ongoing costs.

For Aurora, the steps are similar but the restore configuration asks for a cluster identifier, instance class, and network settings. After the cluster is created, you can connect to the writer endpoint and run a simple query to confirm the data is there.

Automating Restore Tests

Manual tests are fine for a quarterly drill, but for continuous validation you should automate. AWS provides several tools:

  • AWS Backup restore testing API (introduced in 2023) lets you define a restore testing plan that automatically restores recovery points on a schedule and validates them using a custom AWS Lambda function.
  • AWS Lambda and Step Functions can orchestrate a restore, wait for completion, run validation, and then delete the restored resource.
  • Amazon EventBridge can trigger a Lambda function on a schedule (e.g., cron expression) to start the restore test.

Here is a simple automation pattern for EC2:

  1. Schedule an EventBridge rule to fire daily or weekly.
  2. Invoke a Lambda function that calls the AWS Backup startRestoreJob API with the most recent recovery point.
  3. Poll the restore job status until it is COMPLETED.
  4. Run a validation script (e.g., check that a specific file exists, or that a web server responds).
  5. If validation passes, terminate the test instance and log the result.
  6. If it fails, send an alert via SNS.

For Aurora, the same pattern works, but the validation step should connect to the database and run a simple query like SELECT 1 or check that a known table has the expected row count.

Using the Restore Testing Plan (AWS Backup)

AWS Backup's native restore testing plan is the easiest way to automate. You create a plan that specifies:

  • Which backup vaults to test
  • How often to test (e.g., every 24 hours)
  • What recovery point to start with (oldest, latest, or random)
  • A Lambda function that performs the validation

The service automatically starts a restore job, waits for it to complete, runs your Lambda validation, and then deletes the restored resource. You can see the results in the AWS Backup console under Restore testing.

Note that restore testing plans are only available for EC2 and Aurora (as of this writing). For other resources, you must build your own automation.

Common Problems and How to Avoid Them

  • IAM permissions: The AWS Backup service role must have permission to create EC2 instances and Aurora clusters. If the role is too restrictive, restores fail with an access denied error.
  • Encrypted volumes: If the original instance used an encrypted EBS volume, you must have access to the KMS key during restore. Without it, the restore fails.
  • Deregistered AMI: If the original EC2 instance's AMI has been deregistered, the restore cannot launch the instance. Keep a copy of the AMI or use a custom AMI that remains available.
  • Resource limits: Restoring a large Aurora cluster may hit the default limit for the number of instances per region. Check your service quotas.
  • Costs: A restore test creates a full copy of the data, so it incurs storage and compute costs for the duration of the test. Always delete the test resource after validation.

Cost Considerations

AWS Backup charges for the backup storage and for the restore operations. Restore tests add the cost of running the restored EC2 instance or Aurora cluster for the duration of the test. For EC2, that is the hourly instance rate; for Aurora, it is the instance hours plus the storage for the new cluster. To minimize cost, keep the test instance small and terminate it as soon as validation is complete. You can also use a scheduled Lambda to automatically terminate resources that are older than a few hours.

Frequently Asked Questions

Can I restore an EC2 instance to a different region?

Yes, but only if you have configured cross-region backup. AWS Backup can copy recovery points to another region, and then you can restore from that copy. The restore process is the same, but you must select the recovery point in the destination region.

Does restoring an Aurora cluster overwrite my existing cluster?

No. The restore always creates a new cluster with a new identifier. You can then promote it to be the primary or redirect traffic to it. You cannot restore over an existing cluster.

How long does a restore test take?

EC2 restores typically take 5–15 minutes depending on the volume size. Aurora restores take 15–30 minutes because the cluster must be provisioned and the database logs replayed. The restore testing plan adds the time for your validation Lambda, which is usually a few seconds.

What should I validate after a restore?

For EC2, check that the instance boots, the application starts, and the data is current. For Aurora, connect to the writer endpoint and run a query that verifies the expected data exists, such as a row count in a critical table. Also test that the restored instance can connect to any dependent services.

Can I test point-in-time recovery for Aurora with AWS Backup?

AWS Backup only allows you to restore from a snapshot recovery point, not a specific timestamp. To do a point-in-time restore, use the RDS console or API. You can still automate that with a Lambda function that calls the restoreDBClusterToPointInTime API.

What happens if a restore test fails?

The restore job will show a status of FAILED in the AWS Backup console. If you are using a restore testing plan, the validation Lambda can return a failure, and you can configure SNS to send an alert. Investigate the failure by checking the job details and the CloudWatch logs of your Lambda function.