In this lab you will define a dynamic scaling policy for your autoscaling group based on CPU level.
aws ec2 describe-instances --instance-ids <instance_id> --query 'Reservations[0].Instances[0].PrivateIpAddress'
ansible-playbook provision-elb-ec2-metric-alarm-playbook.yml
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names workshop-elb-ec2-metric-alarm-asg --query 'AutoScalingGroups[0].Instances'
aws elb describe-instance-health --load-balancer-name workshop-elb-ec2-metric-alarm-lb
aws cloudwatch describe-alarms --alarm-names cpuDown_workshop-elb-ec2-metric-alarm-asg cpuUP_workshop-elb-ec2-metric-alarm-asg
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names workshop-elb-ec2-metric-alarm-asg --query 'AutoScalingGroups[0].Instances'
aws ec2 describe-instances --instance-ids <instance_id> --query 'Reservations[0].Instances[0].PrivateIpAddress'
scp -i <ssh_key> rpm/stress.rpm <user>@<instance_ip>:/tmp/
ssh <user>@<instance_ip> -i <path_to_key>
sudo su
rpm -i /tmp/stress.rpm
stress -c 50
watch uptime
ansible-playbook provision-elb-ec2-metric-alarm-playbook.yml --extra-vars "state=absent" --tags "asg"
ansible-playbook provision-elb-ec2-metric-alarm-playbook.yml --extra-vars "state=absent" --tags "lc"