AWS Fault Injection Simulator [FIS] #how-to-use
Published: 2023-07-05 19:29:59

**AWS FIS concepts**

AWS FIS allows you to test the performance of an application or system under fault conditions by running experiments on your AWS resources. To conduct experiments, create an experiment template that outlines the actions, targets, and stop conditions. Use the template to run the experiment and monitor its progress until all actions are completed.

**AWS FIS example**

For the FIS experiment we've created an EC2 instance with the following parameters: 

- Platform: Amazon Linux

- AMI ID: ami-06b09bfacae1453cb

- AMI Name: al2023-ami-2023.1.20230629.0-kernel-6.1-x86_64


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mti291rd3tkylfd0ssdz.png)
 
Now, we will move on to creating AWS FIS experiment which will have following set of actions: 

- create experiment template - this is broken down into several steps: Description and Name, Actions, Targets, Service Access, Stop Conditions, Logs, Tags

We need to provide description for our experiment, Name is optional here! 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qc833bhzq12hamjbuez1.png)

We add actions to an experiment template, which AWS FIS uses to run the experiment.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iuzckg4kffxfpwwh9u3c.png)

AWS FIS identifies all targets before starting any action and uses them throughout the experiment.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rkh3up8pcwibggb9wnfa.png)

FIS requires permission to conduct experiments on our behalf.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8jb4rr9fel3m1wrn41jv.png)

Once we've completed all the steps required we can go ahead and click on the 'create experiment template'.

This will trigger the creation of the experiment template which once ready will show up in the experiment templates dashboard.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjpg25lnxt7xmifhfq5o.png)

Then we need too select the experiment template and click on 'start experiment' in order to initiate the AWS FIS experiment.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8uo5kv0sxktln45felo9.png)

You will be prompted with a window which warns you that you are about to 'perform destructive actions on your AWS resources.' Write 'start' in order to confirm the action! 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vx29hsg9jlecuylvuq9s.png)

Next, we need to switch over to the Experiments tab, as the experiment once initiated will be in a 'Running' state.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ic90x34llml37pyp2xtc.png)

Now if we switch over to the EC2 instance dashboard, we will notice that the instance changed its status to 'Stopping' due to the AWS FIS experiment action to stop it. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0jgwwaefaovo7j0e592.png)

Eventually, the ec2 instance comes to a complete stop and changes its status to 'Stopped'. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/timb6ue1hcxlfruchrwz.png)

---
**References:** https://docs.aws.amazon.com/fis/latest/userguide/what-is.html