This repository is a solution of the Terraform Cloud Resume Challenge.
Terraform configuration for creating an AWS EC2 Instance runnning a basic web application in Docker, supported by a Elastic Load Balancer and Auto Scaling Group.
cd s3_remote_backend
terraform init
terraform validate
terraform plan
terraform apply
cd ..
terraform init
terraform validate
terraform plan
terraform apply
- node-alb-1253122593.eu-north-1.elb.amazonaws.com
- Go to the AWS Systems Manager via the AWS Console
- Navigate to the Fleet Manager, the Fleet Manager indicates the SSM Agent is online for the EC2 Instance which indicates the SSM Agent is ready.
- Navigate to Session Manager
-
Start a session with the EC2 Instance
-
Install the
stress
test tool
sudo yum install stress -y
- Initiate a scale up event in the by launching the
stress
test in the background with a cpu--8cores in 800secs
sudo stress --cpu 8 --timeout 800 &
- Autoscale EC2 Instances for scale up event
- Initiate a scale down event by stopping the
stress
test
sudo killall stress
- Terminated EC2 Instances for scale down event