Access Denied Excemtion when Using AWS Elastic Transcoder on website

0

I am getting an 403 error when trying to use AWS Elastic Transcoder on my test site and I can’t seem to figure out where the problem lies. I have checked in my IAM policies and identity pools etc. to no avail.

The error:

GET https:// elastictranscoder.us-east-1.amazonaws.com/2012-09-25/pipelines/xxxxxxxxxxxxx-xxxxxx 403 (Forbidden) index.html:xxx AccessDeniedException: User: arn:aws:sts::xxxxxxxxxxxx:assumed-role/Cognito_Unauth_Role/CognitoIdentityCredentials is not authorized to perform: elastictranscoder:CreateJob on resource: arn:aws:elastictranscoder:us-east-1: xxxxxxxxxxxxx:pipeline/xxxxxxxxxxxxx-xxxxxx

 AWS.config.region = ‘xx - xxx - x’; // Region
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
  IdentityPoolId: "xx-xxx-x:xxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx”,
});

var elastictranscoder = new AWS.ElasticTranscoder();

var button = document.getElementById('button');

button.addEventListener('click', function() {
  var params = {
    PipelineId: ‘xxxxxxxxxxxxxx’,
    /* required */
    Input: {
      Key: “xxxxxxxxxx / xxxxxxx.xxx”
    },
    OutputKeyPrefix: ‘xxxxxxx / ‘,
    Outputs: [{
      Key: ‘xxxx.xxx’,
      PresetId: ‘xxxxxxxxxxxx’,
    }, ],
  };
  elastictranscoder.createJob(params, function(err, data) {
    if (err) console.log(err, err.stack); // an error occurred
    else console.log(data); // successful response
  });
});
Clarel
질문됨 5년 전258회 조회
1개 답변
0

Solution! turns out I didn't know that I needed to include the AWS access key and secret key in the options section of the elastic transcoder constructor.

var elastictranscoder = new AWS.ElasticTranscoder(options = {
  accessKeyId: 'xxxxxxxxxxxxxx',
  secretAccessKey: 'xxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxx'
}
Clarel
답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인