IAM Policy setting (suggestion: improve permission error reporting)

オープン
#448 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
aws, javascript, node.js
領域
cli, cloud

調査の方向性

Start in lib/main.js at line 889, where the issue identifies permission errors being treated as a nonexistent function. Reproduce the deployment with the IAM policy described in the issue and trace the AWS Lambda error handling; done means permission failures report the actual permission problem instead of “Function already exist.”

索引モデルが issue の本文から書いたものです。

説明

enhancement

If this is already somewhere please point it out.

I started with this policy from travis, but node-lambda required a lot more permissions then this:
https://docs.travis-ci.com/user/deployment/lambda/

I was getting this error ResourceConflictException: Function already exist, incorrectly.

Eventually I figured out the error reporting for permissions is very bad in node-lambda. It assumes any permission error is just a non existent function. https://github.com/motdotla/node-lambda/blob/master/lib/main.js#L889

This is the latest version of my IAM policy to get a deploy without errors:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "ListExistingRolesAndPolicies",
            "Effect": "Allow",
            "Action": [
                "iam:ListRolePolicies",
                "iam:ListRoles"
            ],
            "Resource": "*"
        },
        {
            "Sid": "CreateAndListFunctions",
            "Effect": "Allow",
            "Action": [
                "lambda:CreateFunction",
                "lambda:ListFunctions",
                "lambda:ListEventSourceMappings"                
            ],
            "Resource": "*"
        },
        {
            "Sid": "DeployCode",
            "Effect": "Allow",
            "Action": [
                "lambda:GetFunction",
                "lambda:UpdateFunctionCode",
                "lambda:UpdateFunctionConfiguration"
            ],
            "Resource": [
                "arn:aws:lambda:us-east-1:12345:function:abc",
                "arn:aws:lambda:us-east-1:12345:function:abcdef",
                "arn:aws:lambda:us-east-1:12345:function:whatever" 
            ]
        },
        {
            "Sid": "SetRole",
            "Effect": "Allow",
            "Action": [
                "iam:PassRole"
            ],
            "Resource": "arn:aws:iam::12345:role/exec_role"
        },
        {
            "Sid": "S3Uploads",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::mybucket/test/lambdas/*"
        },
        {
            "Sid": "LogsPermission",
            "Effect": "Allow",
            "Action": [
              "logs:CreateLogGroup",
              "logs:PutRetentionPolicy"
            ],
            "Resource": "*"
        }
    ]
}

From travis's doc: It does not appear to be possible to wildcard the DeployCode statement

主要言語
JavaScript
スター
1.4k
フォーク
185
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

motdotla/node-lambda のほかの issue

motdotla/node-lambda の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。