aws returns AccessDeniedException exception (x role is not authorized to perform: iam: PassRole), when I try to create mediaconvert job.
this is how I attach iam role to lambda function in serverless.yml
converter:
handler: src/handlers/videoConverter.handler
role: arn:aws:iam::<X>:role/VODLambdaRole
events:
- s3:
bucket: <Y>
event: s3:ObjectCreated:*
existing: true
this is part of the VODLambdaRole policy, that is necessarry to pass role:
{
"Action": [
"iam:PassRole"
],
"Resource": [
"arn:aws:iam::<X>:role/MediaConvertRole"
],
"Effect": "Allow",
"Sid": "PassRole"
},
{
"Action": [
"mediaconvert:*"
],
"Resource": [
"*"
],
"Effect": "Allow",
"Sid": "MediaConvertService"
},
Ps: I double checked if I had incorrect arns, but they're correct Pps: I even attached AdministratorAccess to that role, but it returns the same error...