AWS Transcribe 服务输出一个访问被拒绝的文件,即使设置了权限

在运行开始转录作业后,我正在为一个项目测试 AWS 转录服务


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

}

文件以指定的名称 .json 正确输出,但内容显示错误


<Error>

  <Code>AccessDenied</Code>

  <Message>Access Denied</Message>

  <RequestId>JDP5*****5QQJ</RequestId>

  <HostId>wnd5k6x********************TDwqIpe53S1w=</HostId>

</Error>

我是 aws 的新手,我不确定问题出在哪里


我是aws的新手,我不确定问题出在哪里。我尝试了不同的 IAM 权限,但输出仍然相同。


MYYA
浏览 103回答 1
1回答

MMTTMM

您很可能需要 S3 存储桶的存储桶策略以允许 AWS Transcribe 访问输入和输出存储桶,例如:{&nbsp; &nbsp; "Version": "2012-10-17",&nbsp; &nbsp; "Statement": {&nbsp; &nbsp; &nbsp; &nbsp; "Effect": "Allow",&nbsp; &nbsp; &nbsp; &nbsp; "Principal": {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "Service": [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "transcribe.amazonaws.com"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; "Action": [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "s3:GetObject",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "s3:ListBucket"&nbsp; &nbsp; &nbsp; &nbsp; ],&nbsp; &nbsp; &nbsp; &nbsp; "Resource": [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET/*"&nbsp; &nbsp; &nbsp; &nbsp; ]&nbsp; &nbsp; }}和{&nbsp; &nbsp; "Version": "2012-10-17",&nbsp; &nbsp; "Statement": {&nbsp; &nbsp; &nbsp; &nbsp; "Effect": "Allow",&nbsp; &nbsp; &nbsp; &nbsp; "Principal": {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "Service": [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "transcribe.amazonaws.com"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]&nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; "Action": [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "s3:PutObject"&nbsp; &nbsp; &nbsp; &nbsp; ],&nbsp; &nbsp; &nbsp; &nbsp; "Resource": [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "arn:aws:s3:::DOC-EXAMPLE-OUTPUT-BUCKET/*"&nbsp; &nbsp; &nbsp; &nbsp; ]&nbsp; &nbsp; }}如此处所述
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go