amazon web services - AWS CloudWatch to start/stop EC2 instances -
just looking way start/stop aws ec2 instance in case of cpu utilization increase or decrease on ec2 instacne. know there service available auto scaling in aws have scenario can't take advantage of service.
so looking if possible or can me on this.
just detailing concern suppose have 2 ec2 instance on aws account name ec21 , ec22. default, ec22 instance stopped.
now need setup cloudwatch or other service check if load/cpu utilization increase on ec21 instance 70% need start ec22 server , if load decrease on ec21 instance 30% stop ec22 server.
please advice!
when cloudwatch alarm triggered, notify sns topic. can have sns topic invoke lambda function, can start ec2 instance.
- create aws lambda function starts ec2 instance.
- configure sns topic invoke lambda function when receives messages. can read here: invoking lambda functions using amazon sns notifications
- finally, ensure cloudwatch alert sends messages sns topic.
Comments
Post a Comment