Amazon Transcribe 和 Golang SDK BadRequestException

Amazon Transcribe and Golang SDK BadRequestException

我将 .flac 文件上传到 Amazon S3 存储桶,但当我尝试使用 Amazon Transcribe Golang SDK 转录音频时,出现以下错误。我尝试在 S3 存储桶 public 中制作 .flac 文件,但仍然出现相同的错误,所以我认为这不是权限问题。是否有任何东西阻止转录服务访问我丢失的 S3 存储桶中的文件?正在上传和转录的 api 用户拥有对 S3 和转录服务的完全访问权限。

示例 Go 代码:

    jobInput := transcribe.StartTranscriptionJobInput{
        JobExecutionSettings: &transcribe.JobExecutionSettings{
            AllowDeferredExecution: aws.Bool(true),
            DataAccessRoleArn:      aws.String("my-arn"),
        },
        LanguageCode: aws.String("en-US"),
        Media: &transcribe.Media{
            MediaFileUri: aws.String("https://s3.us-east-1.amazonaws.com/{MyBucket}/{MyObjectKey}"),
        },
        Settings: &transcribe.Settings{
            MaxAlternatives:   aws.Int64(2),
            MaxSpeakerLabels:  aws.Int64(2),
            ShowAlternatives:  aws.Bool(true),
            ShowSpeakerLabels: aws.Bool(true),
        },
        TranscriptionJobName: aws.String("jobName"),
    }

亚马逊转录回复:

BadRequestException: The S3 URI that you provided can't be accessed. Make sure that you have read permission and try your request again.

我的问题是上传到 s3 的音频文件指定了 ACL。我从 s3 上传代码中删除了它,我不再收到错误。同样根据文档,如果您的 s3 存储桶名称中有 "transcribe",则转录服务将有权访问它。我也进行了更改,但您仍然需要确保您没有使用 ACL