Testing Failover and Resilience with AWS Fault Injection Service
Resilience designs contain assumptions that only testing reveals: whether capacity is enough after losing an AZ, whether clients reconnect after a database failover, whether alarms fire and runbooks work. This lesson explains how to test failover of Multi-AZ and multi-Region workloads, how to run game days, and how AWS Fault Injection Service runs controlled chaos experiments with stop conditions.
Learning outcomes
After completing this lesson, you will be able to:
- Describe methods for testing failover of RDS, Aurora, Route 53 and CloudFront configurations.
- Explain the principles of chaos engineering and how game days are organised.
- Describe AWS FIS experiment templates, actions, targets, stop conditions and scenarios.
- Explain how to run experiments safely, including in production and across accounts.
Testing Failover Mechanisms
Each failover mechanism has a way to exercise it deliberately. The table below lists the standard tests for the services named in the exam guide.
| Mechanism | How to test | What to measure |
|---|---|---|
| RDS Multi-AZ | Reboot with failover | Time until the application writes successfully again |
| Aurora replicas | failover-db-cluster or an AWS FIS action | Application reconnection time and errors |
| Aurora Global Database | Planned switchover to the secondary Region and back | End-to-end Regional RTO |
| Route 53 failover records | Invert the primary health check, or make the primary fail its check | Time until clients resolve the secondary, including TTL |
| CloudFront origin groups | Make the primary origin return a failover status code, or block it | Whether requests are served from the secondary |
| Auto Scaling across AZs | AWS FIS AZ availability scenario or zonal shift | Whether remaining capacity carries the load |
| Backups | AWS Backup restore testing | Restore duration against the RTO |
Route 53 health checks have an invert health check status option that reports a healthy endpoint as unhealthy, which tests failover without breaking the primary. For all tests, the measure that matters is the time until users are served correctly, which includes DNS caching, connection pool behaviour and retries, not only the time until the AWS operation completes.
Chaos Engineering and Game Days
Chaos engineering is the practice of experimenting on a system to build confidence in its ability to withstand turbulent conditions. An experiment states a steady-state hypothesis, such as "order success rate stays above 99.5% and p99 latency below 400 ms", injects a realistic fault, such as terminating instances in one AZ, and observes whether the hypothesis holds. If it does not, the team has found a weakness before a real event did. Experiments start small, in non-production, with a limited blast radius and automatic stop conditions, and grow towards production as confidence increases.
A game day is a planned event in which a team simulates a failure and practises the full response: detection by alarms, escalation, use of runbooks, communication and recovery. Game days test people and processes as well as technology, and their findings feed into runbooks, alarms and architecture.
AWS Fault Injection Service
AWS Fault Injection Service (AWS FIS) runs fault injection experiments on AWS resources. An experiment template defines the experiment, with the following parts.
- Actions
- The faults to inject, run in parallel or in sequence with durations. Examples include stopping, rebooting or terminating EC2 instances; sending Spot interruption notices; stopping ECS tasks and draining container instances; terminating EKS nodes and deleting pods; failing over or rebooting RDS and Aurora; disrupting network connectivity for subnets; pausing EBS volume I/O; injecting API errors and throttling; injecting latency or errors into Lambda invocations; and running SSM documents that stress CPU, memory or disk or add network latency inside instances.
- Targets
- The resources each action affects, selected by ARN, tags, filters and a selection mode such as all, a count or a percentage.
- Stop conditions
- CloudWatch alarms that stop the experiment immediately if they enter the ALARM state, for example when the customer-facing error rate exceeds a threshold, limiting real impact.
- IAM role
- The role FIS assumes to perform the actions, which also limits what an experiment can affect.
- Experiment options and logging
- Logging to CloudWatch Logs or S3, experiment reports, and target account configurations for multi-account experiments.
The FIS scenario library provides pre-built templates for complex events, such as AZ Availability: Power Interruption, which combines stopping instances, interrupting network connectivity, failing over databases and pausing volume I/O in one AZ, and Cross-Region: Connectivity, which blocks traffic between Regions to test multi-Region designs. Multi-account experiments run from a central account against targets in several accounts through target account configurations and roles.
An FIS experiment template
Running Experiments Safely
Experiments must be controlled so that they reveal weaknesses without causing incidents. The practices below are standard.
- Define the steady-state hypothesis and the metrics that measure it before the experiment.
- Configure stop conditions on customer-impacting alarms in every template.
- Limit targets by tags and percentages, starting with one instance or one AZ.
- Restrict the FIS role's permissions, and use IAM conditions or SCPs to control who can start experiments in production.
- Run experiments first in test environments, then in production during staffed hours, and announce them.
- Integrate experiments into pipelines (for example as a Step Functions or Lambda step) so resilience is tested on every significant release, and integrate them with AWS Resilience Hub, which recommends FIS experiments for an application.
Run chaos experiments safely
Verifying an AZ Failure Design
A team claims its checkout service survives the loss of an AZ: three AZs, an Auto Scaling group sized at 150% of peak, Aurora with replicas and ElastiCache with Multi-AZ. Leadership wants evidence.
-
Hypothesis
Checkout success rate stays above 99.5% and p99 latency below 500 ms during an AZ power interruption.
-
Template
Use the AZ Availability: Power Interruption scenario targeting resources tagged Service=checkout in one AZ, with a stop condition on the checkout error-rate alarm.
-
Run
Run in staging under synthetic load, then in production at a quiet time with the team watching.
-
Findings
The experiment reveals that a connection pool kept connections to the failed Aurora writer for 90 seconds; the team adds RDS Proxy and reruns the experiment until the hypothesis holds.
What prevents an AWS FIS experiment from causing a prolonged customer outage if the system does not behave as expected?
Show answer
Stop conditions: CloudWatch alarms in the experiment template that stop the experiment as soon as they enter the ALARM state, together with a limited target selection.
Exam Tips
Remember for the exam
- Test failover deliberately: RDS reboot with failover, failover-db-cluster, Aurora Global Database switchover, Route 53 inverted health checks and CloudFront origin failures.
- Measure the time until users are served correctly, including DNS TTLs and connection pools.
- AWS FIS templates contain actions, targets, stop conditions (CloudWatch alarms) and an IAM role; the scenario library includes AZ power interruption and cross-Region connectivity.
- Start experiments small with a steady-state hypothesis and expand to production; run game days to test people and runbooks.