AWS Transcribe服务输出的文件显示访问被拒绝,即使权限已设置。

huangapple go评论151阅读模式
英文:

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

  1. var TrsSession *transcribeservice.TranscribeService
  2. func TranscribeTest() (trsOutput *transcribeservice.StartTranscriptionJobOutput, err error) {
  3. trsOutput, err = TrsSession.StartTranscriptionJob(&transcribeservice.StartTranscriptionJobInput{
  4. TranscriptionJobName: aws.String("gettysburg_test"),
  5. IdentifyLanguage: aws.Bool(true),
  6. MediaFormat: aws.String("wav"),
  7. OutputBucketName: aws.String(os.Getenv("AWS_BUCKET_NAME")),
  8. Media: &transcribeservice.Media{
  9. MediaFileUri: aws.String("s3://" + os.Getenv("AWS_BUCKET_NAME") + "/gettysburg.wav"),
  10. },
  11. })
  12. if err != nil {
  13. fmt.Println(err)
  14. return trsOutput, err
  15. }
  16. return trsOutput, nil
  17. }

the file outputs properly wwith the specified name .json but the content shows an error

  1. <Error>
  2. <Code>AccessDenied</Code>
  3. <Message>Access Denied</Message>
  4. <RequestId>JDP5*****5QQJ</RequestId>
  5. <HostId>wnd5k6x********************TDwqIpe53S1w=</HostId>
  6. </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访问输入和输出存储桶,例如:

  1. {
  2. "Version": "2012-10-17",
  3. "Statement": {
  4. "Effect": "Allow",
  5. "Principal": {
  6. "Service": [
  7. "transcribe.amazonaws.com"
  8. ]
  9. },
  10. "Action": [
  11. "s3:GetObject",
  12. "s3:ListBucket"
  13. ],
  14. "Resource": [
  15. "arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET",
  16. "arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET/*"
  17. ]
  18. }
  19. }

  1. {
  2. "Version": "2012-10-17",
  3. "Statement": {
  4. "Effect": "Allow",
  5. "Principal": {
  6. "Service": [
  7. "transcribe.amazonaws.com"
  8. ]
  9. },
  10. "Action": [
  11. "s3:PutObject"
  12. ],
  13. "Resource": [
  14. "arn:aws:s3:::DOC-EXAMPLE-OUTPUT-BUCKET/*"
  15. ]
  16. }
  17. }

此处所述。

英文:

You most likely need bucket policies for your S3 buckets to allow AWS Transcribe to access both the input and output buckets, for example:

  1. {
  2. "Version": "2012-10-17",
  3. "Statement": {
  4. "Effect": "Allow",
  5. "Principal": {
  6. "Service": [
  7. "transcribe.amazonaws.com"
  8. ]
  9. },
  10. "Action": [
  11. "s3:GetObject",
  12. "s3:ListBucket"
  13. ],
  14. "Resource": [
  15. "arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET",
  16. "arn:aws:s3:::DOC-EXAMPLE-INPUT-BUCKET/*"
  17. ]
  18. }
  19. }

and

  1. {
  2. "Version": "2012-10-17",
  3. "Statement": {
  4. "Effect": "Allow",
  5. "Principal": {
  6. "Service": [
  7. "transcribe.amazonaws.com"
  8. ]
  9. },
  10. "Action": [
  11. "s3:PutObject"
  12. ],
  13. "Resource": [
  14. "arn:aws:s3:::DOC-EXAMPLE-OUTPUT-BUCKET/*"
  15. ]
  16. }
  17. }

as described here

huangapple
  • 本文由 发表于 2022年11月12日 04:27:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/74407776.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定