Chaos Engineering
Chaos Engineering on Serverless Fargate
Demo Run experiment Task IO stress
In this walkthrough, we’ll create an AWS Fault Injection Simulator (FIS) experiment template to inject I/O stress on an ECS Fargate task. ECS Fargate offers a serverless compute engine for container workloads on Amazon ECS or EKS, eliminating the need to manage EC2 instances. By the end of this tutorial, you’ll know how to configure an FIS template to target Fargate tasks, apply I/O load, and monitor the impact in real time.
Prerequisites
- An existing ECS Fargate service with tasks prefixed by
pay-for-adoption
- IAM role for FIS (e.g.,
AWSFISRole
) withfis.amazonaws.com
trust and necessary permissions - CloudWatch log group (e.g.,
FIS-experiments
) for experiment logs
Table of Contents
- Step 1: Create a New Experiment Template
- Step 2: Define the I/O Stress Action
- Step 3: Configure the Target
- Step 4: Assign IAM Role and Enable Logging
- Step 5: Review and Launch
- References
Step 1: Create a New Experiment Template
- Sign in to the AWS Console and go to AWS Fault Injection Simulator (FIS) > Experiment templates.
- Click Create experiment template, then confirm your AWS account.
- Fill in the basic details:
- Name:
ecs-fargate-io-stress-test
(optional) - Description:
ECS Fargate I/O stress test
- Name:
- Leave other settings at their defaults and proceed to the Actions section.
Step 2: Define the I/O Stress Action
- Under Actions, click Add action.
- For Action name, enter:
ecs-fargate-io-stress-test
- Select AWS ECS Task I/O stress as the Action type.
- Configure action parameters:
Parameter | Value | Description |
---|---|---|
Duration | 10 minutes | Total time to run the I/O stress |
Workers | (default) | Number of parallel I/O workers |
Task count | (default) | Percentage or number of tasks to affect |
- Click Save.
Step 3: Configure the Target
- Scroll to Targets and choose Add target.
- Set Resource type to
ecs:Task
. - Under Target method, pick Resource ID.
- In the filter box, enter the prefix
pay-for-adoption
to find matching tasks. - Select both ECS Fargate tasks from the results.
- Keep Selection mode as All (to target every matching task).
- Click Save.
Step 4: Assign IAM Role and Enable Logging
- Under Experiment role, choose your IAM role for FIS (e.g.,
AWSFISRole
). - In Logs, select Send logs to CloudWatch Logs and choose the log group
FIS-experiments
. - Click Create experiment template to finalize.
Warning
Ensure your IAM role has permissions for both FIS actions and CloudWatch logging. Missing permissions can cause experiment failures.
Step 5: Review and Launch
- On the template summary page, verify:
- The action name and parameters
- The target tasks
- The experiment role and log configuration
- Click Start experiment.
- Monitor the state switch to Running.
After starting, switch to the AWS FIS dashboard to track progress and view metrics like CPU usage, memory, and I/O throughput in real time.
Use these insights to analyze how I/O stress impacts your application’s performance and resilience.
References
Watch Video
Watch video content