Unable to find instance allocation policy in Autoscaling Groups

0

Hello

I want to add the "capacity-optimized" type for instance allocation policy for spot instances, but i can not find it in launch tamplates or autoscaling groups. I do not use spot fleet, but only spot instances separatelly in aws launch templates. I have tried to do it in console and in aws cli, but without succes. Wasted about an hour or even more. In AWS autoscale docs there is 3 or 4 nested blocks for this, so it is uncler to me how the cli command should looks like. Please help to find how to add this using AWS console or cli in order to not use any --input-cli json or other overhead methods for the resource update. Cause i see that this topic is not covered clear in AWS documentation. Thanks.

profile picture
asked 10 months ago259 views
1 Answer
1

Hi, this article is probably the right guidance for your goal:

https://aws.amazon.com/blogs/compute/introducing-the-capacity-optimized-allocation-strategy-for-amazon-ec2-spot-instances/

It gives all details around the options of the command below, which is the one you are looking for

aws ec2 request-spot-instances \
  --instance-count 5 \
  --block-duration-minutes 120 \
  --type "one-time" \
  --launch-specification file://specification.json

Reference doc is at https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/request-spot-instances.html

Hope it helps!

Didier

profile pictureAWS
EXPERT
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions