英文:
AWS Transcribe service outputs a file with access denied, even with permissions set
问题
我正在测试AWS转录服务用于一个项目,在运行开始转录作业之后,文件以指定的名称“.json”正确输出,但内容显示错误。
我对AWS还不熟悉,不确定问题出在哪里。我尝试了不同的IAM权限,但输出仍然相同。
英文:
I am testing the AWS transcribe service for a project, after runing the start transcritpion job
var TrsSession *transcribeservice.TranscribeService
func TranscribeTest() (trsOutput *transcribeservice.StartTranscriptionJobOutput, err error) {
trsOutput, err = TrsSession.StartTranscriptionJob(&transcribeservice.StartTranscriptionJobInput{
TranscriptionJobName: aws.String("gettysburg_test"),
IdentifyLanguage: aws.Bool(true),
MediaFormat: aws.String("wav"),
OutputBucketName: aws.String(os.Getenv("AWS_BUCKET_NAME")),
Media: &transcribeservice.Media{
MediaFileUri: aws.String("s3://" + os.Getenv("AWS_BUCKET_NAME") + "/gettysburg.wav"),
},
})
if err != nil {
fmt.Println(err)
return trsOutput, err
}
return trsOutput, nil
}
the file outputs properly wwith the specified name .json but the content shows an error
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>JDP5*****5QQJ</RequestId>
<HostId>wnd5k6x********************TDwqIpe53S1w=</HostId>
</Error>
I am new to aws I am not sure where the problem is
I am new to aws I am not sure where the problem is.
I tried different IAM permission but still the same output.
答案1
得分: 0
您很可能需要为您的S3存储桶设置存储桶策略,以允许AWS Transcribe访问输入和输出存储桶,例如:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": {
"Service": [
"transcribe.amazonaws.com"
]
},
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET",
"arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET/*"
]
}
}
和
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": {
"Service": [
"transcribe.amazonaws.com"
]
},
"Action": [
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::DOC-EXAMPLE-OUTPUT-BUCKET/*"
]
}
}
如此处所述。
英文:
You most likely need bucket policies for your S3 buckets to allow AWS Transcribe to access both the input and output buckets, for example:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": {
"Service": [
"transcribe.amazonaws.com"
]
},
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET",
"arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET/*"
]
}
}
and
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": {
"Service": [
"transcribe.amazonaws.com"
]
},
"Action": [
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::DOC-EXAMPLE-OUTPUT-BUCKET/*"
]
}
}
as described here
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论