Creating a user policy for calling lambda with a specific alias

I have a specific user that should only call lambdas with an alias of "dev".
After 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 instructions (Gets and Lists) for better reading.

But on the console trying to call this lambda, I get "User: x does not have the right to execute: lambda: InvokeFunction on the resource: arn: aws: lambda: us-east-1: *********: function: HelloWorld "

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

+4
source share

Source: https://habr.com/ru/post/1664686/


All Articles