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