We are using AWS MediaConverter to convert videos to mp4 format. But MediaConvrter is giving this error in the job:
Unable to write to output file [s3://{path_to_file}]: [Failed to write data: Access Denied]
Obviously, MediaConverter doesn't have write access to bucker, but I don't know how to give them to it.
We have following policy for S3:
{
"Version": "2008-10-17",
"Id": "PolicyForCloudFrontPrivateContent",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::{CloudFront-origin}"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::{S3-bucket}/*"
},
{
"Sid": "2",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::{role-for-our-API}",
"arn:aws:iam::{MediaConverter-role}"
]
},
"Action": "*",
"Resource": "arn:aws:s3:::{S3-bucket}/*"
}
]
}
Our ACL gives Write, List permission only for Bucket Owner. Previously everyone could List and Write objects and MediaConverter worked, but we found this we could not accept List and Write permissions for everyone.
Block public access is off for every point.
IAM user that we using for API and Role that we are using for MediaConverter have all the permissions for S3 (AmazonS3FullAccess).
Appreciate any help, thank you.