1

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.

  • What do you mean by "the content shows an error"? Where is this error message being displayed/stored? Is that error only appearing when _you_ try to retrieve the .wav file? It might be that you do not have sufficient permissions to access the object. – John Rotenstein Nov 11 '22 at 22:08

1 Answers1

0

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

Tony BenBrahim
  • 7,040
  • 2
  • 36
  • 49