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
已提問 1 年前檢視次數 268 次
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
專家
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南