【发布时间】: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