5
votes

I have a specific user that must only invoke lambdas with alias "dev".
Following the documentation, I tried the policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "lambda:InvokeFunction"
            ],
            "Resource": "arn:aws:lambda:us-east-1:*********:function:HelloWorld:dev"
        }
    ]
}

I removed the other statements (Gets and Lists) to improve readability.

But on console, trying to invoke that lambda I receive:

User: x is not authorized to perform: lambda:InvokeFunction on resource: arn:aws:lambda:us-east-1:*********:function:HelloWorld"

Is it possible to allow only a specific alias to a specific user?
Obs: It is a user and not a role between resources.

1

1 Answers