LoginSignup
0
0

More than 1 year has passed since last update.

Lambda 関数で EC2 インスタンス作成時にエンコードされた認証メッセージが出力された時の対処方法

Posted at

権限が足りないのは明かです。ただ、Action, Resource がわからないので、対応できません。

エンコードされたメッセージをデコードすることにより、対応ができました。

$ aws sts decode-authorization-message --encoded-message <message>

関数を作成した時に作成した Lambda の実行ロールに、最小特権のベストプラクティスに則り、一つ一つ出力されたものを追加していきました。

...(snip)...
           "Effect": "Allow",
            "Action": [
                "ec2:<xxx>",
...(snip)...
            ],
            "Resource": [
                "<ARN>",
                "<ARN>",
                "<ARN>",
...(snip)...
            ]

なお、iam:PassRole も必要なようでしたので、同じく追加しておきました。

(参考)
https://aws.amazon.com/jp/premiumsupport/knowledge-center/ec2-not-auth-launch/

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