LoginSignup
0
0

An error occurred (InsufficientCapabilitiesException) when calling the CreateChangeSet operation: Requires capabilities : [CAPABILITY_IAM] のエラーが発生した時

Posted at

先日CloudFormation をAWS CLI を使って実行していたところ、
以下のエラーが発生しました。

An error occurred (InsufficientCapabilitiesException) when calling the CreateChangeSet operation: Requires capabilities : [CAPABILITY_IAM]

めちゃめちゃざっくりというと、IAM のパワーが足りませんよ!って言ってます。Role の話ではなく、このIAM を作成するけど了承してないよって言ってます!

その時に打ったコマンド

aws cloudformation deploy \
--template-file alb-ecs.yml \
--stack-name ecs-test

解決方法

AWS CLI で一文を足してあげるだけで解決します。
コンソール上では同意を求められるのですが、コマンド上ではそういうインタラクティブな機能ないらしく、明示的に指定してあげる必要があります。

aws cloudformation deploy \
--template-file alb-ecs.yml \
--capabilities CAPABILITY_NAMED_IAM \
--stack-name ecs-test

補足:

上のコマンドはデプロイするときのコマンドですが、dry run したいなと思ったら、もう一行足してあげる必要があります。--no-execute-changeset をつけることによって、ドライランにすることができます。

aws cloudformation deploy \
--template-file alb-ecs.yml \
--capabilities CAPABILITY_NAMED_IAM \
--stack-name ecs-test --no-execute-changeset

まとめ

Cloudformation は最近仕事でも使用することはたまにあるのですが、いつもコンソールで操作していたため、今回はAWS CLI に挑戦してみました。ローカルから実行した時はかなり操作も便利だなと思ったので、どんどん使っていきたいと思います。
CLI の便利さが際立った場面でした。

参考資料

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0