Your team has an AZ-failure design on paper. A game day with AWS Fault Injection Service (FIS) is where you find out whether it works. It is also an easy way to cause the outage you were trying to rehearse. The usual ways it goes wrong are a target filter that matches more than you meant, a stop condition that never fires because the alarm has no data, and an experiment that "fails" before it injects anything.
This runbook covers the order to work in: preview the targets, wire up stop conditions that really trip, make sure an operator can stop everything at once, run the experiment, and read the result when it goes sideways.
Before you start
| Check | Command or action |
|---|---|
FIS role trusts fis.amazonaws.com and has only the permissions the actions need | Use the AWS managed policies (AWSFaultInjectionSimulatorEC2Access, ...NetworkAccess, ...RDSAccess, ...SSMAccess) as a starting point |
Stop condition alarms exist and are in OK | aws cloudwatch describe-alarms --alarm-names ... |
| Experiment logging goes to CloudWatch Logs or S3 | logConfiguration in the template |
| Safety lever is disengaged and someone knows how to engage it | aws fis get-safety-lever --id default |
| The workload owner and on-call know the window | Post in the incident channel before you start |
Add aws:SourceAccount and aws:SourceArn conditions to the role's trust policy. Without them, any FIS experiment in another account that can name the role could use it (the confused-deputy problem).
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "Service": "fis.amazonaws.com" },
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": { "aws:SourceAccount": "111122223333" },
"ArnLike": { "aws:SourceArn": "arn:aws:fis:eu-west-1:111122223333:experiment/*" }
}
}]
}
Build the template
This template simulates the loss of one AZ for an ASG-based web tier and an Aurora cluster. It blocks network traffic in the AZ's subnets, stops the instances there and fails over the database.
{
"description": "Game day: lose euw1-az1 for web and orders DB",
"roleArn": "arn:aws:iam::111122223333:role/fis-gameday",
"tags": { "Name": "az1-gameday" },
"stopConditions": [
{ "source": "aws:cloudwatch:alarm", "value": "arn:aws:cloudwatch:eu-west-1:111122223333:alarm:gameday-5xx-rate" },
{ "source": "aws:cloudwatch:alarm", "value": "arn:aws:cloudwatch:eu-west-1:111122223333:alarm:gameday-checkout-p99" }
],
"targets": {
"Az1Subnets": {
"resourceType": "aws:ec2:subnet",
"resourceTags": { "gameday": "in-scope" },
"filters": [{ "path": "AvailabilityZoneId", "values": ["euw1-az1"] }],
"selectionMode": "ALL"
},
"Az1Instances": {
"resourceType": "aws:ec2:instance",
"resourceTags": { "aws:autoscaling:groupName": "web-asg" },
"filters": [
{ "path": "Placement.AvailabilityZone", "values": ["eu-west-1a"] },
{ "path": "State.Name", "values": ["running"] }
],
"selectionMode": "ALL"
},
"OrdersCluster": {
"resourceType": "aws:rds:cluster",
"resourceArns": ["arn:aws:rds:eu-west-1:111122223333:cluster:orders"],
"selectionMode": "ALL"
}
},
"actions": {
"blockAz1": {
"actionId": "aws:network:disrupt-connectivity",
"parameters": { "scope": "availability-zone", "duration": "PT15M" },
"targets": { "Subnets": "Az1Subnets" }
},
"stopAz1": {
"actionId": "aws:ec2:stop-instances",
"parameters": { "startInstancesAfterDuration": "PT15M", "completeIfInstancesTerminated": "true" },
"targets": { "Instances": "Az1Instances" }
},
"failoverDb": {
"actionId": "aws:rds:failover-db-cluster",
"targets": { "Clusters": "OrdersCluster" },
"startAfter": ["blockAz1"]
}
},
"experimentOptions": { "accountTargeting": "single-account", "emptyTargetResolutionMode": "fail" },
"logConfiguration": {
"logSchemaVersion": 2,
"cloudWatchLogsConfiguration": { "logGroupArn": "arn:aws:logs:eu-west-1:111122223333:log-group:/fis/gameday:*" }
}
}
TID=$(aws fis create-experiment-template --cli-input-json file://az1-gameday.json \
--query experimentTemplate.id --output text)
Some design choices in this template matter:
- Scope targets with a tag you control (
gameday=in-scope). Don't rely on AZ filters alone. A filter on AZ only will match every subnet in that AZ, including the subnets of shared services. completeIfInstancesTerminatedmatters with Auto Scaling. When the group replaces stopped instances, FIS can't restart them. Without this flag the action, and the experiment, end as failed even though the test did what you wanted.emptyTargetResolutionMode: failis the safer default. A target that resolves to nothing usually means a broken filter, not a healthy system. Useskiponly for templates you run across many environments where some targets are optional.- The
disrupt-connectivityaction works by cloning the subnet's network ACL, adding deny entries and associating the clone with the subnet. Network ACLs are stateless, so existing connections break too, not only new ones. That is closer to a real AZ loss than stopping instances, but long-lived connections such as database pools and gRPC streams will error out instead of draining. Check the current action reference for the ACL entry and subnet limits for each scope.
Tip
If you're rehearsing a full AZ power loss, start from the FIS scenario library's AZ power interruption scenario rather than building it by hand. Then remove the actions you don't want and tighten the targets. The scenario covers EC2, ASG capacity errors, EBS and RDS in one template.
Preview the targets before injecting anything
Run the template with actionsMode set to skip-all. FIS resolves the targets and records them, but runs no actions:
EID=$(aws fis start-experiment --experiment-template-id "$TID" \
--experiment-options actionsMode=skip-all \
--query experiment.id --output text)
aws fis list-experiment-resolved-targets --experiment-id "$EID" \
--query "resolvedTargets[].{target:targetName,type:resourceType,id:targetInformation}" --output table
Read every line. Look for instances from another Auto Scaling group, subnets shared with a NAT gateway or a directory service, or a cluster in the wrong account. A skip-all run doesn't check that the role has permission to run the actions, so the role can still be the cause of a failed real run.
Make stop conditions actually stop things
A stop condition fires only when its alarm goes to ALARM. Two common configurations make that never happen during an AZ test:
- The metric stops reporting. If instances in the broken AZ publish the metric, or a load balancer node there stops reporting, the alarm goes to
INSUFFICIENT_DATA. That state doesn't stop the experiment. Set--treat-missing-data breachingon stop-condition alarms. - The alarm is too slow. Five one-minute periods means five minutes of customer impact before anything stops. Use short periods and M-of-N evaluation (for example 2 of 3 one-minute datapoints).
aws cloudwatch put-metric-alarm --alarm-name gameday-5xx-rate \
--namespace AWS/ApplicationELB --metric-name HTTPCode_Target_5XX_Count \
--dimensions Name=LoadBalancer,Value=app/web-alb/0123456789abcdef \
--statistic Sum --period 60 --evaluation-periods 3 --datapoints-to-alarm 2 \
--threshold 50 --comparison-operator GreaterThanThreshold \
--treat-missing-data breaching
If a stop-condition alarm is already in ALARM when you start, the experiment won't start. Fix the alarm or the workload first. Don't remove the stop condition to get past it.
The emergency stop
Stopping one experiment:
aws fis stop-experiment --id "$EID"
When several teams run experiments in the same account and Region, or you can't tell which experiment is causing harm, engage the safety lever. It stops all running experiments in the account and Region and blocks new ones until someone disengages it:
aws fis update-safety-lever-state --id default \
--state "status=engaged,reason=INC-4821 customer impact during game day"
aws fis get-safety-lever --id default
# After recovery
aws fis update-safety-lever-state --id default --state "status=disengaged,reason=recovered"
Caution
Stopping an experiment ends its actions and reverts the ones FIS can undo, such as the network ACL swap. It can't undo a database failover, terminated instances or data written while the system was degraded. Plan the blast radius as if the stop button will be pressed late.
Grant fis:UpdateSafetyLeverState to your on-call role, not only to the game-day team. Test that role's access before game day.
Monitor the run
watch -n 15 "aws fis get-experiment --id $EID \
--query '{state:experiment.state.status,reason:experiment.state.reason,actions:experiment.actions.*.state.status}' --output json"
At the same time, watch healthy host counts per AZ, the Aurora writer endpoint, error rates and the Auto Scaling activity history. The experiment's own state only tells you what FIS did. Whether your system coped is something you read from the workload's metrics.
When an experiment fails or misbehaves
| Symptom | Likely cause | Fix |
|---|---|---|
failed within seconds, nothing injected | Role is missing a permission, or can't be assumed | Read state.reason and the experiment log; add the missing action to the role |
failed with a target resolution error | Filter or tag matched nothing, or an ARN target doesn't exist | Run skip-all and check resolved targets; fix tags or filters |
| Experiment won't start | A stop-condition alarm is in ALARM | Clear the condition; don't delete the stop condition |
| Stop condition never fired despite impact | Alarm went to INSUFFICIENT_DATA | treat-missing-data breaching; publish the metric from outside the AZ |
stop-instances failed after ASG replaced instances | Instances no longer exist to restart | Set completeIfInstancesTerminated to true |
| Subnet still blocked after the experiment | Something changed the ACL association during the run (IaC apply, Config remediation) | Re-associate the original network ACL; pause drift remediation for in-scope subnets during the window |
skip-all run passes, real run fails | Preview mode doesn't check action permissions | Test the real run in a non-production account first |
To find a subnet that is still on the cloned ACL, compare the association against what your IaC expects:
aws ec2 describe-network-acls \
--filters Name=association.subnet-id,Values=subnet-0abc123 \
--query "NetworkAcls[].{acl:NetworkAclId,tags:Tags,entries:length(Entries)}"
Warning
Don't run
terraform applyor let a remediation rule rewrite network ACLs on in-scope subnets while an experiment is running. If the original association changes under FIS, the automatic restore can fail and leave the subnet isolated after the game day ends.
Prevent it next time
- Keep templates in version control and create them through IaC, with targets scoped by a dedicated tag.
- Run every new or changed template in
skip-allmode, and review the resolved targets before any real run. - Configure stop-condition alarms with short periods and
treat-missing-data breaching, and test them by forcing the alarm state withaws cloudwatch set-alarm-state. - Give on-call
fis:UpdateSafetyLeverStateand document the engage command in the incident runbook. - Send experiment logs to CloudWatch Logs or S3, and keep them with the game-day write-up. Turn each surprise into a backlog item with an owner.
- Start with one action and a short duration, then widen the scope. A 15-minute full AZ loss should be the last test you run, not the first.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get