IAM Policy setting (suggestion: improve permission error reporting)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- aws, javascript, node.js
Research direction
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.”
Written by the indexing model from the issue text.
Description
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
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from motdotla/node-lambda
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
motdotla/node-lambda#840 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
motdotla/node-lambda#641 · 6 comments · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
motdotla/node-lambda#618 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 30/100
motdotla/node-lambda#544 · 1 reaction ·
-
question
Difficulty 4/5 3-5 days Newbie friendliness 25/100
motdotla/node-lambda#537 · 2 comments · 1 reaction ·
All issues in motdotla/node-lambda
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
avniproject/avni-client#2135 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
Difficulty 1/5 Under an hour Newbie friendliness 90/100
matrix-org/matrix.org#3649 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vadimdemedes/ink#1029 ·