AWS Fault Injection Simulator is a fully managed service for running fault injection experiments on AWS that makes it easier to continuously improve an application’s performance, observability, and resiliency.
What is Chaos Engineering?
Chaos engineering is the process of stressing an application in testing or production environments by creating disruptive events, such as server outages or API throttling, observing how the system responds, and implementing improvements.
Can FIS be integrated as part of the CICD pipeline?
Yes, by enabling FIS, you can continuously test the impact of fault actions on your software deployment process.
How can I monitor the impact of a FIS experiment?
With AWS CloudWatch monitoring and dashboards, you can monitor the impact of your FIS experiment on the AWS resources. In addition, AWS CloudTrail logs can provide you with complete visibility and auditing actions that are taken in your account.
2. Introduction to AWS Fault Injection Simulator
To simplify setting up and running controlled fault injection experiments across a range of AWS services, Amazon introduced the Fault Injection Simulator so that teams can build Confidence in their application behavior. With Fault Injection Simulator, teams can quickly set up experiments using pre-built templates that generate the desired disruptions. In addition, the Fault Injection Simulator provides the controls and guardrails that teams need to run experiments in production, such as automatically rolling back or stopping the experiment if specific conditions are met. With a few clicks in the console, teams can run complex scenarios with common distributed system failures happening in parallel or building sequentially over time, enabling them to create the real-world conditions necessary to find hidden weaknesses.
3. Objective & Prerequisites:
We are going to test how our applications handle instance stop and start.
Let us experiment; we can analyze how long it will take the application to come back from a stopped state after the Instance stop and start. It will provide an insight to design your Architecture. Most organizations use this experiment during their Game Days.
Here we are going to test instance Stop and Start using AWS FIS.
First, we need to create an IAM Role that helps us run the FIS experiment. Then, once it has been done, we need to create two EC2 Instances.
4. Create an Experiment Template
Go to AWS Console and select AWS FIS
Click on Create experiment template
Enter a Description, Name and choose IAM Role which you created earlier
Click on Actions
a. Choose Add action
b. Enter a name for the action
c. For Action type, choose aws:ec2:stop-instances. d. For startInstancesAfterDuration, specify 3 minutes (PT3M)
e. Choose Save
For Targets, do the following:
a. Choose Edit for the target that AWS FIS automatically created for you in the previous step
b. For Target method, choose Resource IDs, and then choose the IDs of the two test instances
c. For Selection mode, choose COUNT. For Number of resources, enter 1
d. Choose Save
Choose Add target and do the following
a. Enter a name for the target
b. For Resource type, choose aws:ec2:instance
c. For Target method, choose Resource IDs, and then choose the IDs of the two test instances
d. For Selection mode, choose All
e. Choose Save
From the Actions section, choose Add action. Do the following:
a. For Name, enter a name for the action
b. For Action type, choose aws:ec2:stop-instances
c. For Start after, choose the first action that you added
d. For Target, choose the second target that you added
e. For startInstancesAfterDuration, specify 3 minutes (PT3M).
f. Choose Save
Choose Create experiment template
After creating the Experient Template, we need to Start it
5. Start the Experiment
You should be on the details page for the experiment template that you just created. Otherwise, choose Experiment templates and then select the ID of the experiment template to open the details page.
Choose Actions, Start.
Choose Start experiment
6. Track the Experiment’s Progress
You should be on the details page for the experiment that you just started. Otherwise, choose Experiments and then select the ID of the experiment to open the details page.
To view the state of the experiment, check state in the Details pane.
When the state of the experiment is Running, go and verify it.
7. Verify the Experiment Results
Go to EC2 Console,
When the state of the first action changes from Pending to Running (AWS FIS console), the state of one of the target instances changes from Running to Stopped (Amazon EC2 console)
a. After three minutes, the state of the first action changes to Completed, the state of the second action changes to Running, and the state of the other target instance changes to Stopped.
b. After three minutes, the state of the second action changes to Completed, the state of the target instances changes to Running, and the state of the experiment changes to Completed
c. We have successfully completed our experiment. We can use this experiment to test how our applications handle instance stop and start
8. Final Thoughts
AWS FIS uses Chaos Engineering, a disciplined approach to identify failures before they become outages. By proactively testing how a system responds under stress, you can identify and fix failures. So many Organizations like Netflix, LinkedIn, Facebook, Google, Microsoft, and Amazon has Chaos Engineering Team to predict and identify potential shortcomings by breaking things on purpose.
9. About CloudThat
CloudThatis on a mission to build a robust cloud computing ecosystem by disseminating knowledge on technological intricacies within the cloud space. Our blogs, webinars, case studies, and white papers enable all the stakeholders in the cloud computing sphere to advance in their businesses.
As a pioneer in the Cloud consulting realm, CloudThatis AWS (Amazon Web Services) Advanced Consulting Partner, AWS authorized Training Partner, Microsoft Gold Partner, and Winner of the Microsoft Asia Superstar Campaign for India: 2021.