Reputation: 51
I am able to have cross-account access on a public S3 bucket bucketA. However, I need the Athena service and boto3 library to access the same S3 bucketA which is now a private resource.
How can it be done ?
Regards, Aarushi
Upvotes: 0
Views: 492
Reputation: 269390
When Amazon Athena runs queries, it uses the current user's access permissions to access Amazon S3.
Therefore, if you want a particular user to run Athena queries against data in S3, simply make sure that this user has access to the relevant Amazon S3 buckets.
Let's say you have:
User-A
) in Account-ABucket-B
) in Account-BUser-A
to run Amazon Athen queries against data in Bucket-B
You should:
User-A
that permits them to access Bucket-B
(presumably s3:ListBucket
and s3:GetObject
, at a minimum)Bucket-B
that permits access by User-A
(this is required for cross-account access) -- the permissions should be the same as the IAM Policy (eg s3:ListBucket
and s3:GetObject
at a minimum)That should allow User-A
to run queries on data in Bucket-B
.
See the documentation: Cross-account Access in Athena to Amazon S3 Buckets - Amazon Athena
Upvotes: 2