Athena Cross-Querying S3 bucket in me-central-1

0

Hello,

I am using Athena in us-east-2 and have tables that have locations to s3 buckets that are in many different regions. I have no problem querying any other region except for me-centra-1, which gives me this error: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Bad Request (Service: Amazon S3; Status Code: 400; Error Code: 400 Bad Request. This is not a permissions issue. When I perform aws s3 ls against that region, I have to include --region me-central-1. How do I fix this, as Athena syntax to my knowledge does not support a region argument when specifying s3 bucket location. I do not want to query with Athena in that region, or cross-replicate bucket.

Noah
asked a month ago587 views
1 Answer
0

The first thing that comes to mind is that me-central-1 is one of the opt-in regions, so it isn't enabled by default. If the S3 bucket is in a different AWS account from the account where you're running Athena, I believe you'll have to enable the region in both accounts, so that the security tokens Athena obtains in account A to access the bucket in the opt-in region in account B will be valid for the target region.

EXPERT
Leo K
answered a month ago
profile picture
EXPERT
reviewed a month ago