Cloud watch alaram
- SNS -> Topic -> configure user -> sub
- cloud watch need enable and alaram rule
create sns
-> topic -> same region where you instance running -> standard name: cpu-alerts -> create subscription -> open mail confirm
create sns from portal

subscription

confirm subscription by open email confirm link

create vm with iam role having access ssm and cloud watch
-> vm -> iam role -> enable cloudwatch -> install stress tool
sudo apt update && sudo apt install stress htop -y
nproc # print no of process
stress --cpu "$(nproc)" --timeout 600 # run ten min
create alaram
- select metric –> ec2 –> perinstance –> search for instance by instance id –> select CPUUtilization

- condition set config >= 70

- select actions which required like notification, trigger lambda, instance action (stop, terimate…etc)…etc

- provide name and desc and tags


- review and create alaram.
run below increase cpu
sudo apt install stress-ng -y
stress-ng --cpu 0 --cpu-load 80 --timeout 5m --metrics-brief
final validation increase stress and check your email

