<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> 
<dfn>AWS Fargate</dfn> は,
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ECS</anchor>
の機能です。</p><section><h1>概要</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite xml:lang="ja-JP">AWS Fargate のご紹介</cite>
(<time>2017-12-02 11:11:44 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://aws.amazon.com/jp/about-aws/whats-new/2017/11/introducing-aws-fargate-a-technology-to-run-containers-without-managing-infrastructure/">https://aws.amazon.com/jp/about-aws/whats-new/2017/11/introducing-aws-fargate-a-technology-to-run-containers-without-managing-infrastructure/</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <cite>AWS Fargateとは? - Qiita</cite>
(<time>2017-12-12 14:17:45 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://qiita.com/riywo/items/1a5b50028542d9bb06cc">https://qiita.com/riywo/items/1a5b50028542d9bb06cc</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <cite xml:lang="ja-JP">AWS Fargate – サーバーやクラスターの管理が不要なコンテナの実行</cite>
(<time>2018-01-18 11:05:07 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://aws.amazon.com/jp/fargate/?sc_channel=PS&amp;sc_campaign=acquisition_JP&amp;sc_publisher=google&amp;sc_medium=fargate_b&amp;sc_content=fargate_e&amp;sc_detail=fargate&amp;sc_category=fargate&amp;sc_segment=241388692036&amp;sc_matchtype=e&amp;sc_country=JP&amp;sc_brand=brand&amp;ef_id=WcTjRAAAARd0j29e:20180120073341:s">https://aws.amazon.com/jp/fargate/?sc_channel=PS&amp;sc_campaign=acquisition_JP&amp;sc_publisher=google&amp;sc_medium=fargate_b&amp;sc_content=fargate_e&amp;sc_detail=fargate&amp;sc_category=fargate&amp;sc_segment=241388692036&amp;sc_matchtype=e&amp;sc_country=JP&amp;sc_brand=brand&amp;ef_id=WcTjRAAAARd0j29e:20180120073341:s</anchor-external></p></section><section><h1>東京リージョン</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <cite xml:lang="ja-JP">AWS Fargate の 東京リージョン対応予定がアナウンスされました | Amazon Web Services ブログ</cite>
(<time>2018-06-01 11:27:55 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://aws.amazon.com/jp/blogs/news/aws-fargate-tokyo-launch/">https://aws.amazon.com/jp/blogs/news/aws-fargate-tokyo-launch/</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <cite xml:lang="ja-JP">AWS Fargate 東京リージョン サービス開始のお知らせ | Amazon Web Services ブログ</cite>
(<time>2018-07-04 14:16:06 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://aws.amazon.com/jp/blogs/news/aws-fargate-tokyo/">https://aws.amazon.com/jp/blogs/news/aws-fargate-tokyo/</anchor-external></p></section><section><h1><code>awscli</code> の Fargate 対応</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <pre class="code">Parameter validation failed:
Unknown parameter in input: &quot;requiresCompatibilities&quot;, must be one of: family, taskRoleArn, networkMode, containerDefinitions, volumes, placementConstraints
Unknown parameter in input: &quot;executionRoleArn&quot;, must be one of: family, taskRoleArn, networkMode, containerDefinitions, volumes, placementConstraints
Unknown parameter in input: &quot;memory&quot;, must be one of: family, taskRoleArn, networkMode, containerDefinitions, volumes, placementConstraints
Unknown parameter in input: &quot;cpu&quot;, must be one of: family, taskRoleArn, networkMode, containerDefinitions, volumes, placementConstraints
Unknown parameter in containerDefinitions[0]: &quot;healthCheck&quot;, must be one of: name, image, cpu, memory, memoryReservation, links, portMappings, essential, entryPoint, command, environment, mountPoints, volumesFrom, linuxParameters, hostname, user, workingDirectory, disableNetworking, privileged, readonlyRootFilesystem, dnsServers, dnsSearchDomains, extraHosts, dockerSecurityOptions, dockerLabels, ulimits, logConfiguration</pre></p><p>この <code>awscli</code>
のエラーは、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Fargate</anchor>
未対応という意味です。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">プラットフォーム</anchor>によっては提供されている
<code>awscli</code>
が極めて古く、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Fargate</anchor>
が登場して何年も経つ未だにこのエラーに遭遇することがあります。
<code>awscli</code>
を最新化すれば解消します。
<time>2020-10-21T01:38:46.400Z</time></p></section><section><h1>Fargate Spot</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> <cite><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">AWS Fargate</anchor> キャパシティープロバイダー - Amazon ECS</cite>, <time>2022-04-04T01:53:12.000Z</time>, <time>2022-04-06T06:23:53.644Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/userguide/fargate-capacity-providers.html">https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/userguide/fargate-capacity-providers.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> 
<cite>put-cluster-capacity-providers — AWS CLI 1.22.89 Command Reference</cite>, <time>2022-04-05T19:38:46.000Z</time>, <time>2022-04-06T07:11:52.960Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://docs.aws.amazon.com/cli/latest/reference/ecs/put-cluster-capacity-providers.html">https://docs.aws.amazon.com/cli/latest/reference/ecs/put-cluster-capacity-providers.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <cite xml:lang="ja"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Fargate</anchor>をスポットで7割引で使うFargate Spotとは? #reinvent | DevelopersIO</cite>, <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">濱田孝治</anchor>, <time>2022-04-06T06:23:37.000Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://dev.classmethod.jp/articles/fargate-spot-detail/">https://dev.classmethod.jp/articles/fargate-spot-detail/</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Fargate Spot</anchor> 登場以前に作成した cluster で Spot を使う方法:
古い cluster は
「デフォルトのキャパシティープロバイダー戦略」
に
「FARGATE」
「FARGATE_SPOT」が出てきません。</p><p><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal> には新しい cluster を作れば古い cluster にも選択肢が出てくるようなことが書かれていますが、
本段落執筆時点ではそうなりません。(新しい cluster でだけしか出てきません。)</p><p><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;10</anchor-internal> には
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Web</anchor>
からは設定できず、初回は
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">AWS CLI</anchor>
を使うしかないと説明されています。
ところがそこに書かれている通りに実行してもエラーになります。</p><p><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;13</anchor-internal>
によると、本段落執筆時点で最新の方法はこうです (動作確認しました):</p><pre class="code">aws ecs put-cluster-capacity-providers \
    --cluster <var>cluster-name</var> \
    --capacity-providers FARGATE FARGATE_SPOT \
    --default-capacity-provider-strategy capacityProvider=FARGATE,weight=1 \
    --region <var>region</var></pre><p>(1回実行すれば次から <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Web</anchor> で設定できるようになるので、
<code>--default-capacity-provider-strategy</code> は適当で良い。)</p></section><section><h1>メモ</h1></section></body></html>