Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set permissions to public, Elastic Transcoder Amazon SDK

How I can make all files public using Amazon.ElasticTranscoder.Model (.NET, C#). Here is my code:

public static void CreateJobRequest(string videoPath, string bucketName)
{
string accsessKey = CloudSettings.AccessKeyID;
string secretKey = CloudSettings.SecreteKey;
var etsClient = new AmazonElasticTranscoderClient(accsessKey,secretKey, RegionEndpoint.USEast1);
var notifications = new Notifications()
{
Completed = "arn:aws:sns:us-east-1:XXXXXXXXXXXX:Transcode",
Error = "arn:aws:sns:us-east-1:XXXXXXXXXXXX:Transcode",
Progressing = "arn:aws:sns:us-east-1:XXXXXXXXXXXX:Transcode",
Warning = "arn:aws:sns:us-east-1:XXXXXXXXXXXX:Transcode"
};

var pipeline=etsClient.CreatePipeline(new CreatePipelineRequest()
{
Name = "MyFolder",
InputBucket = bucketName,
OutputBucket = bucketName,
Notifications = notifications,
Role = "arn:aws:iam::XXXXXXXXXXXX:role/Elastic_Transcoder_Default_Role"

}).CreatePipelineResult.Pipeline;
etsClient.CreateJob(new CreateJobRequest()
{
PipelineId = pipeline.Id,
Input = new JobInput()
{
AspectRatio = "auto",
Container = "mp4",
FrameRate = "auto",
Interlaced = "auto",
Resolution = "auto",
Key = videoPath

},
Output = new CreateJobOutput()
{
ThumbnailPattern = videoPath+"videoName{resolution}_{count}",
Rotate = "0",
PresetId = "1351620000000-000020",
Key = videoPath+"newFileName.mp4"
}
});
}

Everything works perfect, but transcoded files are private. How I can set it to public?

like image 631
Valula Avatar asked Mar 22 '13 15:03

Valula


People also ask

What is AWS Elastic transcoder?

Amazon Elastic Transcoder is media transcoding in the cloud. It is designed to be a highly scalable, easy to use and a cost effective way for developers and businesses to convert (or “transcode”) media files from their source format into versions that will playback on devices like smartphones, tablets and PCs.

How do I give someone permission in AWS?

Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/ . Choose Users in the navigation pane, choose the name of the user whose permissions you want to modify, and then choose the Permissions tab. Choose Add permissions, and then choose Copy permissions from existing user.

What is the default permission to access a resource in AWS?

Permissions let you specify access to AWS resources. Permissions are granted to IAM entities (users, groups, and roles) and by default these entities start with no permissions. In other words, IAM entities can do nothing in AWS until you grant them your desired permissions.

Which type of source is specified when creating an elastic transcoder job configuration?

User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in key/value pairs.


2 Answers

I've just had this issue today and the way to resolve it is as follows:

In your Pipeline under "Configure Amazon S3 Bucket for Transcoded Files and Playlists"

  1. Use the "+ Add a permission link".
  2. Select "Grantee Type" as "Amazon S3 Group".
  3. Select "Grantee" as "All Users".
  4. Then check "Access" as "Open/Download" AND "View Permission"
  5. Save changes.

You can repeat this for any thumbnails that are generated in the section directly beneath: "Configure Amazon S3 Bucket for Thumbnails".

like image 73
timstermatic Avatar answered Sep 20 '22 19:09

timstermatic


Just to add to @timstermatic answer - I only had to grant 'Open/Download' access to make the objects public.

The 'View Permissions' option is used to allow anyone to read the ACL (Access Control List) of the object, not to view the object itself - that's taken care of by the 'Open/Download' option.

As usual with AWS terms, it's easy to misinterpret - it's not 'Permission to View the Object', it's 'View the Object's Permissions'.

(Sorry I couldn't add this as a comment, I don't have enough rep.)

like image 35
Dan Weaver Avatar answered Sep 19 '22 19:09

Dan Weaver