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
질문됨 일 년 전270회 조회
1개 답변
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
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠