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
preguntada hace un año270 visualizaciones
1 Respuesta
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
EXPERTO
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas