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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ