7

Logged in as IAM user and trying to create lambda function but seeing below error, what is missing her?

User: arn:aws:iam::123334324324234:user/[email protected] is not authorized to perform: iam:CreatePolicy on resource: policy AWSLambdaBasicExecutionRole-e3e28520-4b65-439e-a006-24de73479562

2 Answers 2

11

When you create a AWS Lambda in the AWS Console a few things are done in the background by AWS. One such thing is creating a role/policy for your Lambda automatically.

To do so, your user (arn:aws:iam::123334324324234:user/[email protected]) needs the iam:CreatePolicy permission.

This is something a account administrator can fix for you.

4

adding iam:CreateRole is not enough, you need to add also several other permissions to the user, something like this

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "iam:AttachRolePolicy",
                "iam:CreateRole",
                "iam:CreatePolicy",
                "iam:PutRolePolicy"
            ],
            "Resource": "*"
        }
    ]
}

Note. I am not sure that all these policies are required.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.