In this tutorial, you’ll prepare an AWS Fault Injection Simulator (FIS) experiment that simulates an Availability Zone (AZ) power outage. We’ll walk through creating the IAM role, defining trust and task policies, and attaching them so FIS can safely perform the experiment. Prerequisites:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- AWS CLI installed and configured
- Permissions to create IAM roles and policies
- A Linux or MacOS terminal
1. Change to the AZ experiment directory
Navigate to the folder containing the experiment files:| File | Description |
|---|---|
| az-impairment-dashboard.yaml | CloudWatch dashboard for impairment metrics |
| disable-enable-cross-zone-alb.sh | Script to toggle cross-zone ALB settings |
| fis-az-experiment-policy.json | Trust policy for FIS role |
| fis-az-experiment-template.json | FIS experiment template |
| fis-az-task-policy.json | Task policy defining FIS permissions |
| restart-user-traffic.sh | Script to restart user traffic |
| shift-traffic-out-of-az-all-albs.sh | Shift traffic out of AZ for all ALBs |
| shift-traffic-out-of-az-one-alb.sh | Shift traffic out of AZ for one ALB |
| withzonalshift.sh | Script to run full zonal-shift |
2. Define the trust policy
Open fis-az-experiment-policy.json and verify it grantsfis.amazonaws.com permission to assume the role:
3. Create the IAM role
Run the following command to create thefis-az-role with the above trust policy:
4. Review the FIS task policy
Next, review fis-az-task-policy.json, which grants FIS permissions to perform AZ failover operations. Key sections include:-
Auto Scaling group
-
Network ACL management
-
RDS failover and reboot
-
ElastiCache AZ power interruption
These permissions let FIS safely describe and modify Auto Scaling groups, manage network ACLs tagged for FIS use, fail over RDS clusters, reboot instances, and interrupt power in ElastiCache clusters.
5. Attach the task policy to the IAM role
Attach fis-az-task-policy.json to thefis-az-role so it can execute the experiment actions:
Next, proceed to Implement the FIS Experiment to launch the test.