1
votes

I am trying to figure out the way to create a custom autoscale policy for autoscaling in AWS using boto. I saw that the scale out and scale in policies are defined using system dependent resources like CPU utilization. But I want the scale out/in policy to be defined in a way that it calls a REST API and compare the response with some values. How can I make it possible?

I am using CircleCi as CI tool. I have 2 ec2 instances running as CircleCi- builders. During the weekends we generally don't require 2 instances. So I need to autoscale with min 1 and max 3 ec2 instances. If there are builds in the queue I wan to spin up a new ec2 and if the queue is empty for more that say 2 hours I want to scale down to just 1 ec2 VM as circleci builder. I can get the builds in queue information using CircleCi REST API.

1
what is the new resource metric using which you want to autoscale? apart from what is provided by cloudwatch? - Ali

1 Answers

2
votes

Autoscaling doesnt do that for you. The reverse works though, you can execute a policy.

What you could also do is send your custom metrics to cloudwatch, configure an alarm on that and add an autoscaling action to the alarm.