Coder
Coder

Reputation: 3262

How to enable one region to another in AWS

I am using Amazon Connect and storing the call recording in one region.

I have Amazon Transcribe in another region and I followed How to create an audio transcript with Amazon Transcribe | AWS to convert the audio file to transcript format. Steps seem very simple.

However, when I click on Create in Amazon Transcribe (to convert the audio recording file generated by connect to Transcript), it is throwing the error: the recording is there in other region (which is expected in my case, because the recorded (audio file) is not there in the same region)

The S3 URI that you provided points to the incorrect region. Make sure that the bucket is in the XXX-XXX region and try your request again.

where xxx-xxx is the region of Amazon Transcribe. It is expected the recording (audio file) to be there in the same region.

But:

  1. Is there a way to expose the S3 bucket with an audio file so that It can be accessed from other regions too?
  2. If not, what is the other way to solve this?

Upvotes: 1

Views: 395

Answers (1)

Michael - sqlbot
Michael - sqlbot

Reputation: 179064

"Is there a way to expose the S3 bucket...?"

As it turns out, exposing the bucket isn't the problem. Buckets are always physically located in exactly one region, but are accessible from all regions as well as from outside AWS if the requester is in possession of appropriate and authorized credentials and no policy explicitly denies the access.

But nothing in S3 about the bucket can be changed to fix the error you're getting, because the problem is somewhere else -- not S3.

From the API data types in the Amazon Transcribe Developer Guide:

MediaFileUri

The S3 location of the input media file. The URI must be in the same region as the [Amazon Transcribe] API endpoint that you are calling.

https://docs.aws.amazon.com/transcribe/latest/dg/API_Media.html

Transcribe was designed not to reach across regional boundaries to access media in a bucket, and stops you if you try, with the message you're getting.

Why does it work that way? Possibly performance/efficiency. Possibly security. Possibly to help unwitting users avoid unexpected billing charges for cross-region data transport. Possibly other reasons, maybe in combination with the above.

Possible solutions:

  • Use Connect, an S3 bucket, and Transcribe, all in the same region; or
  • Use two buckets and S3 Cross-Region Replication to replicate files from the Connect region to the Transcribe region. Be aware that this ca have significant costs at scale, since S3 is moving data acroas regional boundaries. Be further aware that replication is fast but not instantaneous, so calls to Transcribe might fail to find media that has arrived in the first bucket but not yet the second; or
  • Use two buckets, and make a call in your code to S3's PUT+Copy API to copy the file to the second bucket in the Transcribe region, before calling Transcribe.

Upvotes: 2

Related Questions