I will make an array of Varnish servers using Amazon Auto Scaling. With that, I'll have to send a purge request to all servers that are as healthy on the load balancer.
It is possible? What is the easiest way to do? Should I use API?
I will make an array of Varnish servers using Amazon Auto Scaling. With that, I'll have to send a purge request to all servers that are as healthy on the load balancer.
It is possible? What is the easiest way to do? Should I use API?
That's fairly straightforward using awscli / API.
Get healthy instance IDs from ELB using aws elb describe-instance-health
. Lots of examples here: AWS CLI - elb describe-instance-health
Get IP addresses of your healthy instances by using aws ec2 describe-instances
. Docs here: AWS CLI - ec2 describe-instances
Once you have IP addresses just do what is needed on your EC2 instances (make sure your security groups are set up properly).