AmazonFogareの中身を確認するためにECS Execを有効にする必要がある。
しかしなぜかECS Execの有効化ができなかったので解決策を共有する。
(ググっても同じ事象が出てこなかったので)
結論
AWS CLIのバージョンが合わなかったので再インストールしたら通った。
事象
以下のコマンドでECS Execを有効化を行う。
aws ecs update-service --cluster [クラスター名] --service [サービス名] --enable-execute-command
しかし、--enable-execute-commandというオプションなんてないよ!というエラーが出る。
% aws ecs update-service --cluster [クラスター名] --service [サービス名] --enable-execute-command
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
Unknown options: --enable-execute-command
ポリシーなどの見直しもしたけど、そういうのじゃないんだよねって雰囲気がぷんぷんしている。
やったこと
こちらの素晴らしい記事に辿り着いた
なんとなく読んでいると
AWS CLI 対応バージョン
- v1 1.19.28 以降
- v2 2.1.31 以降
という記述を発見。
まさかなと思って自分の環境を調べると
% aws --version
aws-cli/2.0.30 Python/3.7.4 Darwin/22.3.0 botocore/2.0.0dev34
......これじゃん。
ということで再インストールすると正常に完了した。
% aws --version
aws-cli/2.11.10 Python/3.11.2 Darwin/22.3.0 exe/x86_64 prompt/off
% aws ecs describe-services --cluster [クラスター名] --service [サービス名] | grep enableExecuteCommand
"enableExecuteCommand": true
なんで2.0系がインストールされていたのか...なんでなのか...それだけが気がかり