Testing Recovery with Chaos Engineering in AWS FIS
This lesson explains how chaos engineering with AWS Fault Injection Service (AWS FIS) injects failures deliberately and under control to prove that systems and teams recover as expected before a real outage tests them.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the parts of an experiment template.
- Identify the failures FIS can inject.
- Explain how stop conditions keep experiments safe.
Experiment templates
An AWS Fault Injection Service (FIS) experiment template has three parts. Actions are the faults to inject, such as stopping instances, adding network latency, throttling API calls or failing over a database. Targets are the resources affected, selected by tags, IDs or filters, with a selection mode such as a percentage of matching instances, so the blast radius is controlled. Stop conditions are CloudWatch alarms that halt the experiment automatically if it causes more harm than intended. They are what makes it safe to experiment on real systems. The following table summarises the parts.
| Part | Defines |
|---|---|
| Actions | The faults to inject |
| Targets | Resources affected, selected by tags, IDs or filters, with a selection mode such as a percentage |
| Stop conditions | CloudWatch alarms that halt the experiment |
What FIS can do
FIS actions cover the failures that matter most in AWS architectures. At the compute level, it stops, terminates or reboots EC2 instances, drains ECS tasks and terminates EKS nodes and pods. Through Systems Manager, it injects CPU, memory, disk and network stress, or added latency, inside instances. At the service level, it throttles or fails AWS API calls, which shows how applications behave when a dependency is overloaded, fails over RDS and Aurora databases, disrupts network connectivity and pauses EBS I/O.
Scenarios combine many actions to reproduce realistic events, such as an Availability Zone power interruption, which affects instances, databases and network paths in one zone together, or a loss of cross-Region connectivity, which tests multi-Region designs. Experiments can span several accounts, matching how applications are actually deployed.
Running experiments safely
Fault injection experiments must be planned and controlled to avoid unintended impact. The recommended procedure is as follows.
-
Form a hypothesis
For example: "if one AZ fails, latency stays under 200 ms and no errors occur".
-
Limit the scope
Restrict the experiment with the FIS IAM role and start in test with a narrow blast radius.
-
Run with stop conditions
Tie stop conditions to customer-impact alarms.
-
Observe and fix
Watch metrics and alarms, then fix the gaps found.
Multi-account experiments test applications spread across accounts. Combine with game days and Resilience Hub, which can recommend experiments.
Testing the loss of an Availability Zone's network
The hypothesis is: "if all subnets in one AZ lose connectivity for ten minutes, the checkout service keeps its error rate below 1%". An FIS experiment disrupts the subnets in one AZ and stops if the customer-facing alarm fires:
{
"description": "Disrupt connectivity in euw1-az1 for 10 minutes",
"roleArn": "arn:aws:iam::111111111111:role/fis-network",
"targets": {
"az1Subnets": {
"resourceType": "aws:ec2:subnet",
"resourceTags": { "app": "checkout" },
"filters": [{ "path": "AvailabilityZone", "values": ["eu-west-1a"] }],
"selectionMode": "ALL"
}
},
"actions": {
"disrupt": {
"actionId": "aws:network:disrupt-connectivity",
"parameters": { "scope": "all", "duration": "PT10M" },
"targets": { "Subnets": "az1Subnets" }
}
},
"stopConditions": [{ "source": "aws:cloudwatch:alarm",
"value": "arn:aws:cloudwatch:eu-west-1:111111111111:alarm:checkout-error-rate" }]
}Typical findings from such experiments include load balancer health checks that take too long to remove the impaired zone, a database connection pool pinned to the old writer, and capacity that is not statically stable. Each finding becomes a fix and the experiment is repeated.
What stops an FIS experiment that harms customers?
Show answer
Stop conditions: CloudWatch alarms in the experiment template that end the experiment as soon as they enter the ALARM state.
Exam Tips
Remember for the exam
- Safe chaos experiments use FIS with CloudWatch alarm stop conditions.
- To simulate an Availability Zone outage, use the FIS AZ power interruption scenario.
- To test behaviour when AWS APIs throttle, use FIS API throttling actions.
- Select experiment targets by tags.
- Validate disaster recovery and resilience regularly with game days.