Member-only story
Chaos Engineering with the AWS Fault Injection Service (FIS)
Randomly killing EC2 instances: A Terraform project
AWS recently made the Fault Injection Service (FIS) available in major regions. Time to do a Terraform project trying a new service.
Basic Setup

The Terraform code deploys an application load balancer addressing an auto scaling group of EC2 instances.
The auto scaling setting requires at least two EC2 instances running in the group. Each EC2 instance runs a web server that returns the instance ID of the EC2.
Some basic definitions in locals.tf:
Variables:
Provider and VPC:
Certificates to be used with the application load balancer:
The target group definition for the application load balancer, accessible via http/80, and a default health check on the root URL: