Table of contents
1.
Introduction
2.
AWS Fault Injection Simulator
3.
AWS Fault Injection Simulator Features
4.
Experiment templates for AWS Fault Injection Simulator
4.1.
Components of Experiment Template
5.
Action Set for AWS Fault Injection Simulator
5.1.
Action Syntax
6.
AWS Fault Injection Simulator Targets
7.
Stop Conditions for AWS Fault Injection Simulator
8.
Running Test Instance Start and Stop using AWS FIS
9.
Running CPU Stress on Instance using AWS Fault Injection Simulator
10.
Monitoring AWS Fault Injection Simulator
11.
Data protection in AWS Fault Injection Simulator
11.1.
Encrypts at Rest
11.2.
Encrypts in Transit
12.
Frequently Asked Questions
12.1.
What is a stop condition?
12.2.
What is AWS Fault Injection Simulator?
12.3.
What is an Action Sets in AWS FIS?
12.4.
What is a target in AWS Fault Injection Simulator?
12.5.
What do you mean by encrypts at Rest?
13.
Conclusions
Last Updated: Mar 27, 2024
Easy

AWS Fault Injection Simulator

Author Gaurav joshi
0 upvote

Introduction

Let us suppose you are a developer working day in and day out to develop your application. You do all that is in your hand to create a fantastic application. You worked on all the suggestions and all improvements tirelessly. After doing all of that hard work, being a developer, it's become a dream to know how well your application is working under disruptive events. If there is any unforeseen situation, you will handle it now itself. To achieve that, AWS came up with AWS File Injection Simulator. AWS FIS helps the developer know how his application responds to different sets of real-time events. 

This article will briefly discuss and explain all about AWS Fault Injection Simulator and how it has become an essential tool for developers. So let us go ahead and see AWS FIS in detail.     

                                                                                

                                                                                         Source:- memegenerator.net

 

AWS Fault Injection Simulator

Source:- aws.amazon.com

 

AWS Fault Injection Simulator is a fully managed service by AWS for running fault injection experiments on AWS that helps us to improve an application's performance, observability, and resiliency. Stressing an application during testing and production environments by creating disruptive events like a sudden increase in CPU or a sudden increase in memory consumption, Observing all the system's responses to these events, and thus applying improvement.

AWS FIS helps teams create the real-world conditions needed to uncover the hidden bugs, monitor blind spots, and performance bottlenecks that are difficult to find in distributed systems. So you understand about AWS FIS. Now is the time to look for some of its features.

AWS Fault Injection Simulator Features

Having talked about AWS Fault Injection Simulator, it's time to learn some of its features. Most features are already discussed, but we will be looking at its features in detail in this section.

  • Simple Setup
  • Run real-world scenarios
  • Fine-grained safety controls
  • Integrated security model
  • Visibility throughout an experiment
  • Console and programmatic access

Experiment templates for AWS Fault Injection Simulator

We have discussed AWS FIS quite a lot. Now, what is an experiment template is the question that might be scratching your head. Don't worry. We will look into it in this section. An experiment template is an essential thing for AWS FIS.

An experiment template consists of actions needed to run on the specified target during the experiment. An experiment template also includes the stop condition. We will discuss all stop conditions in detail throughout the article till now; you can understand stop condition is a mechanism that prevents the experiment from going out of bounds. After creating an experiment template, the user could use it to run an experiment.

Components of Experiment Template

  • Action Sets
    An action set contains the AWS FIS actions that the user wants to run on its target. We must specify at least one action set in our experiment template. We can run actions in a definite set order or could be run simultaneously. 


Source:- aws.amazon.com
 

  • Targets
    AWS Resources on which activities need to be carried out.

 Source:- aws.amazon.com
 

  • Stop Conditions
    A stop condition is a mechanism that prevents the experiment from going out of bounds.

Source:- aws.amazon.com

Action Set for AWS Fault Injection Simulator

Having Discussed the Action Set above, let's understand them in detail. An action set is defined inside the experiment template. An action set contains the AWS FIS actions that the user wants to run on its target. We must specify at least one action set in our experiment template. We can run actions in a definite set order or could be run simultaneously.

Action Syntax

While defining an action, we need to specify the following condition

  • Action Name
  • Action Identifier
  • Action Description
  • Action Parameters
  • Any previous action that needed to run before this otherwise action would run at the start of an experiment.
  • Action Targets
     

Below is an explanation of Action Syntax

{
    "actions": {
        "action_name": {
            "actionId": "aws:service:action_name",
            "description": "string",
            "parameters": {
                "name": "value"
             },
            "startAfter": "action_name",
            "targets": {
                "resource_type": resource_name"
            }
        }
    }
}

AWS Fault Injection Simulator Targets

So you all may be wondering what we meant by the target in AWS Fault Injection Simulator. A target here is one or more AWS Resources on which AWS Fault Injection Simulator performs actions. Users define the target when they create an experiment template. A user could use the same target for multiple actions in their experiment template.

While defining a target, the user must specify the following:

  • What is the resource type?
  • How we could identify these resources (through resource IDs, filters, or tags)
  • Which of the identified resources to run the action on (the selection mode)
     

AWS Fault Injection Simulator identifies all the targets at the start of our experiment before starting any of the actions from the actions set. If AWS FIS doesn't find any targets, the experiment fails.

Stop Conditions for AWS Fault Injection Simulator

What do you understand by the stop condition for AWS Fault Injection Simulator?

 They are nothing but a mechanism. A mechanism to stop the experiment once it reaches its threshold. If any experiment reaches a threshold defined by the user in the AWS CloudWatch Alarm, the AWS FIS stops the experiment; this is AWS FIS Stop Condition. A Stop condition is a mechanism that helps us stop an experiment if it reaches its threshold that is defined by the user in an Amazon CloudWatch alarm. If the stop condition is somehow triggered during the experiment, AWS FIS stops the experiment. We cannot resume a stopped experiment.

Running Test Instance Start and Stop using AWS FIS

Developers can use AWS Fault Injection Simulator (AWS FIS) to test how their applications will handle instance stop and start. We will see how we create an experiment template that could use the AWS FIS aws:ec2:stop-instances action to stop one instance and then a second instance. Before that, first, any user must complete the below-described prerequisites.

  • Note ID of both instances by running two test EC2 instances in our account
  • Creating an IAM role enables the AWS FIS service to perform the stop instance action on our behalf.
  • If you are an IAM, then make sure to get access to AWS FIS Console.
     

After satisfying the above prerequisites, we could start running test instances Start and Stop. To run Start and Stop Test Instance follow the given methods.

  1. Create an Experiment Template
  2. Start the experiment
  3. Track your experiment progress
  4. Verify your experiment results
  5. Clean up

Running CPU Stress on Instance using AWS Fault Injection Simulator

As explained as an example, Developers could use AWS Fault Injection Simulator (AWS FIS) to test how their applications handle CPU stress. To run CPU stress, complete the following prerequisite.

  • Create an IAM Role
  • Verify Access to AWS FIS
  • Prepare a test EC2 instance
  • Enable detailed monitoring

 

After satisfying all the prerequisites, we can run CPU stress in our application using AWS Fault Injection Simulator.

  1. Creating a CloudeWatch Alarm for Stop Condition
  2. Creating an Experiment Template
  3. Start the Experiment
  4. Track the Experiment Progress
  5. Verify Experiment Results
  6. Clean Up

Monitoring AWS Fault Injection Simulator

Every developer knows the importance of tools that help him monitor all changes, progress, and impact in the project.AWS Fault Injection Simulator's primary use is to run fault injection experiments on AWS that help us to improve an application's performance, observability, and resiliency. How can a developer make the changes if he cannot monitor these progress and impacts? Users can use the following tools to monitor the progress and impact of their AWS Fault Injection Simulator (AWS FIS) experiments.

  • AWS FIS console and AWS CLI
    We can use the AWS FIS console or the AWS CLI to monitor our running experiment's progress. The user could view the status of every action of the experiment and the results of each action.
     
  • CloudWatch usage metrics and alarms
    We can use CloudWatch usage metrics to provide us visibility into our account's usage of resources. 
     
  • AWS FIS experiment logging
    Capture all detailed information about our experiment as it runs by enabling Experiment Logging
     
  • Experiment state change events
    EventBridge enables users to respond automatically to system events or resource changes. AWS FIS emits a notification each time the state of an experiment changes.
     
  • CloudTrail logs
    AWS CloudTrail allows us to capture all detailed information about the calls made to the AWS FIS API and store them as log files in Amazon S3. CloudTrail also logs calls made to service APIs for the resources.
     

                                                                          

                                                                                     Source:- memegenerator.net

Data protection in AWS Fault Injection Simulator

Source:- aws.amazon.com

So you have made it this far. Now we will be discussing data protection in AWS Fault Injection Simulator.AWS Fault Injection Simulator protects user data using the shared responsibility model of AWS. Protection of all the global infrastructure that runs on AWS Cloud is the responsibility of AWS. Users are responsible for maintaining control over the content they host on the infrastructure. This content includes the security configuration and management tasks for the AWS services. For our Data Protection and integrity, AWS Encrypts our data in two stages

Encrypts at Rest

AWS Fault Injection Simulator encrypts our data at rest. Data is encrypted using transparent server-side encryption. This encryption helps us reduce the operational burden and complexity involved in protecting our sensitive data. We can build sensitive applications for security purposes and meet encryption compliance and regulatory requirements with encryption at rest.

Encrypts in Transit

AWS Fault Injection Simulator encrypts our data while in transit between the service and other integrated AWS services. All our data passes between AWS FIS, and integrated services are encrypted using Transport Layer Security (TLS).

Frequently Asked Questions

What is a stop condition?

 A Stop condition is a mechanism that helps us stop an experiment if it reaches its threshold that is defined by the user in an Amazon CloudWatch alarm. If the stop condition is somehow triggered during the experiment, AWS FIS stops the experiment. We cannot resume a stopped experiment.

What is AWS Fault Injection Simulator?

AWS Fault Injection Simulator is a fully managed service by AWS for running fault injection experiments on AWS that helps us to improve an application's performance, observability, and resiliency.

What is an Action Sets in AWS FIS?

An action set is defined inside the experiment template. An action set contains the AWS FIS actions that the user wants to run on its target. We must specify at least one action set in our experiment template.

What is a target in AWS Fault Injection Simulator?

A target here is one or more AWS Resources on which AWS Fault Injection Simulator performs actions. Users define the target when they create an experiment template. A user could use the same target for multiple actions in their experiment template. Its AWS Resources on which activities need to be carried out.

What do you mean by encrypts at Rest?

AWS Fault Injection Simulator encrypts our data at rest. Data is encrypted using transparent server-side encryption. This encryption helps us reduce the operational burden and complexity involved in protecting our sensitive data. 

Conclusions

This article extensively discussed the AWS Fault Injection Simulator and covered its working, feature, Data protection, Experiment Template, and critical concepts.

After reading about the AWS Fault Injection Simulator, are you not feeling excited to read/explore more articles on the topic of AWS? Don't worry; Coding Ninjas has you covered. To learn, see AWS FeaturesAWS Lambda Foundations - Part 1AWS SAMLGlobal Infrastructure Concept in AWS.

Refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Competitive Programming, Data Structures and Algorithms, JavaScript,  System Design, and much more! To test your competency in coding, check out our mock test series and participate in the hosted contests in Coding Ninjas Studio! If you have just begun your learning process and are looking for good quality questions asked by tech giants like Google, Amazon, Microsoft, Uber, etc., Look at our interview experiences and interview bundle for placement preparations.

Nevertheless, you may also consider our paid courses to give you an edge over others!

Please upvote our blogs if you find them engaging and helpful!

Happy Learning!

Live masterclass