Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS IAM Lambda "is not authorized to perform: lambda:GetFunction"

When I have my IAM Policy for my lambda execution role set to:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "lambda:GetFunction"
            ],
            "Resource": [
                "*"
            ],
            "Effect": "Allow"
        }
    ]
}

I get this error:

[AccessDeniedException: User:
arn:aws:sts::xxx:assumed-role/supercoolsoftware-dev-us-west-2-lambdaRole/supercoolsoftware-dev-addEmail
is not authorized to perform: 
lambda:GetFunction on resource:
arn:aws:lambda:us-west-2:xxx:function:supercoolsoftware-dev-dailyEmail]

However, when I set the policy to:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "lambda:*"
            ],
            "Resource": [
                "*"
            ],
            "Effect": "Allow"
        }
    ]
}

The error is gone... What else do I need to add?

like image 496
CamHart Avatar asked Jun 06 '17 03:06

CamHart


People also ask

What is Lambda Getfunction?

Returns the configuration information of the Lambda function and a presigned URL link to the . Open AWS documentation Report issue Edit reference.

Is not authorized to perform Lambda InvokeFunction?

The error is saying the user under which the nodejs program is running does not have rights to start the Lambda function. You need to give your IAM user the lambda:InvokeFunction permission: Find your User in the IAM Management Console and click it.

Is not authorized to perform IAM PassRole on?

If you receive an error that you're not authorized to perform the iam:PassRole action, your policies must be updated to allow you to pass a role to Resource Groups. Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service-linked role.

Which of the following permissions would be required for the package to function correctly in an AWS Lambda environment?

The correct permissions for all executable files within a Lambda deployment package is 644 in Unix permissions numeric notation.


1 Answers

Figured it out. Apparently the SDK uses "lambda:GetFunctionConfiguration" as well. Once I included that it all worked.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "lambda:GetFunction",
                "lambda:GetFunctionConfiguration"
            ],
            "Resource": [
                "*"
            ],
            "Effect": "Allow"
        }
    ]
}
like image 109
CamHart Avatar answered Oct 04 '22 22:10

CamHart