Defenestrator6
Defenestrator6

Reputation: 425

How can I set the MAX capacity of an autoscaling group with boto3?

Lets say I have a cluster with 3 instances, and when it was created I wanted 3 instances. I can use a scaling policy to manipulate it between 0-3 but obviously it hits the limit of the MAX capacity.

I can update this on the front end but don't see an API call for it.

How do I set the max capacity of an autoscaling group?

Ideally there is a way to do this without creating a new one then deleting the old one. If that is the only way, do I need to make the cluster "aware" of the new scaling group?

Upvotes: 1

Views: 3194

Answers (1)

erik258
erik258

Reputation: 16275

You don't need to recreate the group. http://boto3.readthedocs.io/en/latest/reference/services/autoscaling.html#AutoScaling.Client.update_auto_scaling_group can adjust the Max capacity . Other than adjusting the desired capacity down to the max if necessary, you can change only the max capacity without side effects.

You can also do so from the cli. Boto3 clients and awscli commands are both usually pretty faithful to the underlying apis.

Upvotes: 1

Related Questions