I am trying to create elemental media converter job, in order to transcode some video files in my S3 bucket.
This is my backend code
const client = new MediaConvertClient({
region: 'us-east-1',
endpoint: 'https://abcdefghi.mediaconvert.us-east-1.amazonaws.com',
credentials: fromCognitoIdentityPool({
clientConfig: { region: 'us-east-1' },
identityPoolId: 'us-east-1:xxxx-xxx-xxx-xxx-xxxxxxx',
})
});
const command = new CreateJobCommand(job);
const response = await client.send(command);
as job
object I'm using the JSON object copied from media convert console, of an successfully finished job.
Once I run this code, I'm getting the following error:
Error: AccessDeniedException: User: arn:aws:sts::XXXXX:assumed-role/Cognito_MyAppElementalMediaConverterUnauth_Role/CognitoIdentityCredentials is not authorized to perform: mediaconvert:CreateJob on resource: *
I've created Cognito identity pool in console, and attached following policies to Unauthenticated roles:
UPDATE:
After adding endpoint uri, to MediaConvertClient()
, I was able to authenticate, but now I'm getting
AccessDeniedException: User: arn:aws:sts::XXXXXXX:assumed-role/Cognito_MyAppeElementalMediaaConverterUnauth_Role/CognitoIdentityCredentials is not authorized to perform: iam:PassRole on resource: arn:aws:iam::XXXXX:role/*
Even though I've added those permissions for Cognito_MyAppeElementalMediaaConverterUnauth_Role
in AWS console