> ## 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.

# Demo AWS Fault Injection Simulator

> Demo showing how to use AWS Fault Injection Simulator to create IAM roles, author and run experiment templates, inject EC2 failures, and verify observability and recovery

In this lesson you'll use AWS Fault Injection Simulator (FIS) to inject a controlled EC2 failure and observe how your workload, monitoring, and operational processes respond. This walkthrough covers creating the required IAM role, authoring an experiment template, running the experiment, and performing post-experiment observability checks.

Overview

* Create an IAM role that FIS can assume to perform actions on your behalf.
* Create an experiment template that targets one or more resources and defines the fault to inject.
* Start the experiment, monitor progress, and review results (including CloudTrail and FIS logs).

## Step 1 — Create the FIS IAM role

1. In the AWS Console, open IAM and create a role that FIS can assume.
2. The role must include a trust policy allowing the service principal `fis.amazonaws.com` to assume it and must grant the permissions required by the experiment (for example, permissions to stop EC2 instances).
3. Attach least-privilege permissions required for the actions you will run (for example, a policy that allows `ec2:StopInstances` on the target instance(s) and `iam:PassRole` if needed).

Example trust policy for the experiment role:

```json theme={null}
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": { "Service": "fis.amazonaws.com" },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

Tip: If you plan to run multiple fault types (stop, reboot, network latency), create narrowly scoped policies for each action and attach only what’s required for the template.

## Step 2 — Create an experiment template

1. Open the FIS console and choose “Create experiment template.”
2. Define one or more targets using resource identifiers (for example, EC2 instance IDs or tags that match the instances you want to test).
3. Add one or more actions (for example, `aws:ec2:stop-instances`) and set the action parameters:
   * Region (for example, `us-east-2`)
   * Duration or timeout, if applicable
   * Any additional action inputs required by the action
4. Associate the experiment with the IAM role you created in Step 1.
5. Review and save the template. You can reuse templates for repeatable testing.

## Step 3 — Start the experiment and observe

Start the experiment from the FIS console. The experiment will move through these states: Pending → Running → Completed (or Failed). While the experiment runs, monitor FIS’s Timeline, Actions, and Targets views to track progress and action status.

![A screenshot of the AWS Resilience Hub (Fault Injection Service) console showing an active experiment page for ID EXPA1NX8wS1RxHfGtA. Visible are buttons like Refresh, Actions and a highlighted "Stop experiment" button, plus experiment details including the state "Running."](https://mintcdn.com/kodekloud-c4ac6d9a/NJ9FmMaxSEmD0TY-/images/AWS-Certified-DevOps-Engineer-Professional/Domain-5-Incident-and-Event-Response/Demo-AWS-Fault-Injection-Simulator/aws-resiliencehub-fis-running-experiment.jpg?fit=max\&auto=format\&n=NJ9FmMaxSEmD0TY-\&q=85\&s=05107e05b0d23e697b36e496654e9a5f)

As the experiment executes, FIS assumes the experiment role and performs the specified actions against the target instance(s). In this demo the injected fault instructs FIS to stop the selected EC2 instance. Track progress in the FIS console and verify the resource state in the EC2 console.

Check the EC2 console for the target instance to confirm impact:

![A screenshot of the AWS Management Console showing an AWS Fault Injection Simulator (FIS) experiment details page. The Actions summary lists an aws:ec2:stop-instances action with start/end timestamps and the us-east-2 region.](https://mintcdn.com/kodekloud-c4ac6d9a/NJ9FmMaxSEmD0TY-/images/AWS-Certified-DevOps-Engineer-Professional/Domain-5-Incident-and-Event-Response/Demo-AWS-Fault-Injection-Simulator/aws-fis-experiment-ec2-stop-instances-us-east-2.jpg?fit=max\&auto=format\&n=NJ9FmMaxSEmD0TY-\&q=85\&s=ae6f73b6fa3d3f74eb7623d7c83cfc16)

The FIS Actions summary will display start and end timestamps, action status (e.g., succeeded or failed), the action ID (such as `aws:ec2:stop-instances`), and the region and target resources.

Inspect the stopped EC2 instance in the EC2 console to verify the expected state change:

![A screenshot of the AWS EC2 Instances console showing one instance named "WebServerA" (instance ID starting i-0d96...) listed as Stopped. The instance type is t3.micro and the "Launch instances" button is visible.](https://mintcdn.com/kodekloud-c4ac6d9a/NJ9FmMaxSEmD0TY-/images/AWS-Certified-DevOps-Engineer-Professional/Domain-5-Incident-and-Event-Response/Demo-AWS-Fault-Injection-Simulator/aws-ec2-webservera-stopped-launch-button.jpg?fit=max\&auto=format\&n=NJ9FmMaxSEmD0TY-\&q=85\&s=717adf58fefbe5755dfe15302de4463f)

After the experiment completes, FIS shows a completion status and details about the run, including creation/start times, the IAM role used, targeted account, and action outcomes.

Example of the target ARN that was used in this demo:

```text theme={null}
arn:aws:ec2:us-east-2:635573991785:instance/i-0d96cc656ab9a987c
```

![A screenshot of the AWS Management Console showing an AWS FIS (Fault Injection Simulator) experiment details page for experiment EXPA1NX8wS1RxHfGtA with status "Completed." The details panel shows creation/start times, IAM role, and account-targeting information.](https://mintcdn.com/kodekloud-c4ac6d9a/NJ9FmMaxSEmD0TY-/images/AWS-Certified-DevOps-Engineer-Professional/Domain-5-Incident-and-Event-Response/Demo-AWS-Fault-Injection-Simulator/aws-fis-experiment-completed-details.jpg?fit=max\&auto=format\&n=NJ9FmMaxSEmD0TY-\&q=85\&s=bce89b880a17abfd1363b819b9f25973)

## Observability and post-experiment checks

* Use the Timeline view in FIS to monitor remaining duration and progress of actions while the experiment runs.
* Review the Targets and Actions sections to confirm which resources were affected and whether each action completed successfully.
* Check Log events in FIS and consult CloudTrail for a full audit trail of API calls made by FIS during the experiment.
* Validate your monitoring, alerting, and automated recovery mechanisms to ensure they behave as expected during the injected failure.

Table — FIS concepts at a glance

| Concept | Purpose | Example |
| -: | - | - |
| Experiment template | Defines the experiment configuration and reusable settings | Create once, run many |
| Target | Resource(s) under test | `instance/i-0d96cc656ab9a987c` |
| Action | The fault injected | `aws:ec2:stop-instances` |
| Experiment role | IAM role FIS assumes to perform actions | Trust policy with `fis.amazonaws.com` |
| Experiment run | A started execution of a template | Status: Running → Completed |

## Links and references

* AWS Fault Injection Simulator (FIS) docs: [https://docs.aws.amazon.com/fis/latest/userguide/](https://docs.aws.amazon.com/fis/latest/userguide/)
* AWS CloudTrail: [https://docs.aws.amazon.com/awscloudtrail/latest/userguide/](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)
* IAM documentation: [https://docs.aws.amazon.com/IAM/latest/UserGuide/](https://docs.aws.amazon.com/IAM/latest/UserGuide/)
* EC2 documentation: [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/)

Key takeaways for the AWS Certified DevOps Engineer – Professional exam and real-world testing:

* Experiment template: stores experiment configuration and inputs.
* Target: the resource(s) being tested (instance IDs or tag-based selectors).
* Action: the specific fault injected (for example, `aws:ec2:stop-instances`).
* Experiment role: the IAM role FIS assumes to perform actions.
* Experiment run: executes the template to inject the fault so you can validate monitoring and recovery behavior.

> **[Watch Video](https://learn.kodekloud.com/user/courses/aws-certified-devops-engineer-professional/module/0054c8f3-16fd-4414-be5f-d43fc173b566/lesson/d4fb25e9-71eb-4d91-a785-8b0f256bd988)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.