【问题标题】:Access Denied Excemtion when Using AWS Elastic Transcoder on website在网站上使用 AWS Elastic Transcoder 时访问被拒绝例外
【发布时间】:2019-07-30 22:45:17
【问题描述】:

尝试在我的测试站点上使用 AWS Elastic Transcoder 时出现 403 错误,我似乎无法找出问题所在。我检查了我的 IAM 政策和身份池等,但无济于事。

错误:

获取 https:// elastictranscoder.us-east-1.amazonaws.com/2012-09-25/pipelines/xxxxxxxxxxxxx-xxxxxx 403(禁止)index.html:xxx AccessDeniedException:用户: arn:aws:sts::xxxxxxxxxxxx:假​​定角色/Cognito_Unauth_Role/CognitoIdentityCredentials 无权执行:elastictranscoder:CreateJob on resource: arn:aws:elastictranscoder:us-east-1: xxxxxxxxxxxxx:管道/xxxxxxxxxxxx-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
  });
});

【问题讨论】:

    标签: javascript amazon-web-services aws-sdk aws-elastictranscoder


    【解决方案1】:

    解决方案!原来我不知道我需要在弹性转码器构造函数的选项部分中包含 AWS 访问密钥和密钥。

    var elastictranscoder = new AWS.ElasticTranscoder(options = {
      accessKeyId: 'xxxxxxxxxxxxxx',
      secretAccessKey: 'xxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxx'
    } 

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-02-04
      • 2015-11-12
      • 2015-09-25
      • 1970-01-01
      • 1970-01-01
      • 2020-05-05
      • 2012-09-13
      相关资源
      最近更新 更多