iam:PassRole permission denied when trying to attach a role to a Lambda Function in AWS Playground

Hi

I am trying to create a Lambda Function in AWS Playground. When I try to attach a custom role for the Lambda Function, it throws an error like “You don’t have permission to iam:PassRole”. The role I have created has a policy attached to it with the following permissions:

EC2:
“ec2:TerminateInstances”,
“ec2:StartInstances”,
“ec2:StopInstances”

CloudWatch Logs:
“logs:CreateLogGroup”,
“logs:CreateLogStream”,
“logs:PutLogEvents”

Is AWS lambda service not allowed in the AWS playground or is there any workaround?

Thanks!

I am also getting error when i am trying to create cdk, connected to iam:PassRole . please share workaround or solution.
Thanks

Hi,

I just checked the AWS playground, and everything seems fine with Lambda and IAM roles. I can create a new Lambda with a new role or a custom role with a custom policy. Please try again and share a screenshot, it will be really helpful. Then, I’ll assist you in checking it.

In cdk, cloudformation:DeleteChangeSet, iam:PassRole need to assign in user role. It will work with console, since CDK is very restricted, this permission need to assign explicitly.

please read for IAM passrole

Please read this note in our FAQ; the playgrounds allow some of this, but with significant restrictions.