We are going to use Siege once again to create load on the environment so the alarm can be triggered.
Execute the following command on your Cloud9 Workspace and watch for the CPU Utilization to go up.
alb_url=$(aws cloudformation describe-stacks --stack-name container-demo-alb --query 'Stacks.Outputs[?OutputKey==`ExternalUrl`].OutputValue' --output text 2> /dev/null || aws cloudformation describe-stacks --stack-name ecsworkshop-frontend | jq -r '.Stacks.Outputs | select(.OutputKey | contains("FrontendFargateLBServiceServiceURL")) | .OutputValue') siege -c 200 -i $alb_url
In about 5 minutes or so you will see the CPU Utilization crossing the 50% mark as shown below.
This will trigger the alarm we configured earlier. Notice the state of the alarm is In alarm as shown below.
You will also receive an email notification such as the one below.