Issue uploading C# function to AWS Lambda - not authorized to perform: iam:PassRole"

0

I am brand new to using Lambda except for a tiny bit of exploration a while back. I am trying to upload a HelloWorld app created from a template in Visual Studio. I can see the various services in the "AWS Explorer" window including three previous Lambda functions created in the past. For some reason I cannot upload this generic hello world function using Visual Studio.

The error message I am getting is:

Creating new Lambda function MedFlaminator Error creating Lambda function: User: arn:aws:iam::xxxxxxxxxxxxxxxx:user/LambdaDeveloper is not authorized to perform: iam:PassRole on resource: arn:aws:iam::xxxxxxxxxxxxxxxx:role/service-role/helloWorld because no identity-based policy allows the iam:PassRole action

Frustrating as I am following this tutorial here that says nothing about this PassRole. I do find other pages but they are clear as mud.

Can someone please help me understand this issue and how to resolve?

1개 답변
0

This likely means that the account you are using to connect to AWS (LambdaDeveloper, it looks like) does not have permission to create Lambda functions. Go into the IAM section of the AWS console and see what permissions and policies are associated with the LambdaDeveloper user, and make sure that the proper policies have been attached.

For example:

  • Go to IAM > Users
  • Click on the LambdaDeveloper user
  • Click the blue "Add permissions" button
  • Choose "Attach existing policies directly"
  • Search for "AWSLambda_FullAccess" and click the checkbox next to it
  • Click the blue "Next: Review" button
  • Click the blue "Add permissions" button

Then try to upload your Lambda function as before.

Note that this is the down and dirty approach to verify that it's a permission problem. Instead of attaching permissions directly to a user as above, it would be better to create a User group (e.g. "developer"), attach the Lambda permissions to that group, and then associate the user with the group. Also, you may not want to grant "Full Access" to Lambda, but something more constrained to the purpose at hand. That can be quite a long topic, so best left for another time.

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠