Permission issue on creating a Lambda Function Using CLI (AWS Level 2, Practice 16)

I have created the required python script and zipped it. Then, I’m trying with the following AWS CLI command and having the permission error as follow, Could someone please help with it?

~ on ☁️  (us-east-1) ✖ aws lambda create-function \
    --function-name devops-lambda-cli \
    --runtime python3.13 \
    --role arn:aws:iam::058264248815:role/lambda_execution_role \
    --handler lambda_function.lambda_handler \
    --zip-file fileb://function.zip

An error occurred (AccessDeniedException) when calling the CreateFunction operation: User: arn:aws:iam::058264248815:user/kk_labs_user_109751 is not authorized to perform: iam:PassRole on resource: arn:aws:iam::058264248815:role/lambda_execution_role because no identity-based policy allows the iam:PassRole action

I’ve tested in my own AWS account with the similar steps and it’s worked. So, it maybe the permission issuse on KokeKloud Engineering user. Correct me if I miss any steps to do in the Lab.

Please try it again now.

1 Like

Yeah, I’ve just checked and it’s worked properly now.

1 Like

Thank you all! Now it’s worked.