Day 34 - Facing error for Lamda function creation as user doesn't have enough access pass the IAM role

am getting the below error when passing the IAM role in the Lambda function creation CLI commands. Help to solve this.

An error occurred (AccessDeniedException) when calling the CreateFunction operation: User: arn:aws:iam::374577096375:user/kk_labs_user_224502 is not authorized to perform: lambda:CreateFunction on resource: arn:aws:lambda:ap-south-1:374577096375:function:xfusion-lambda-cli with an explicit deny in a service control policy

If there console credentials are shared then I can modify user’s access.

Help to resolve this.

Please look at our playground FAQ. You can’t create an arbitrary role for this, but you can create one of the following roles, and it should work:

  • lambda_execution_role
  • CodeDeployRole
  • EC2InstanceRole
  • CodePipelineServiceRole
  • eksClusterRole
  • eksWorkerNodeRole

It actually doesn’t matter which of these you use, but the first one even has an appropriate name :slight_smile:

This too is an issue:

Please create resources in us-east-1