Skip to content

To enable users to access Athena query

0

Hi experts,

I created a Crawler table from CSV data in one of our s3 buckets, and I created a view in Athena database using that table. How can I allow users who don't have the permission to the s3 bucket to be able to the queries on the Athena view?

Thanks in advance

asked a year ago279 views
1 Answer
0

You can allow users to query an Athena view without giving them direct access to the underlying S3 bucket data by using AWS Lake Formation's fine-grained access control capabilities.

Here's how to set it up:

  1. Create a Data Catalog view using the CREATE PROTECTED MULTI DIALECT VIEW statement with the SECURITY DEFINER clause in Athena.

  2. Have a Lake Formation administrator grant SELECT permissions on the Data Catalog view to the users who need access. This allows these users (the "Invokers") to query the view without having access to the underlying base tables or S3 bucket.

  3. Make sure the role that creates the view (the "Definer") has full SELECT permissions on all underlying tables referenced by the view.

  4. Ensure that your table's S3 location is registered as a Lake Formation data lake location.

  5. For Athena query results, since Lake Formation permissions don't limit access to query results locations, use workgroups to specify the location for query results and align workgroup membership with Lake Formation permissions. Then use IAM permissions policies to limit access to these query results locations.

This approach allows your users to run queries against the view using conventional SQL SELECT syntax without requiring direct access to the underlying S3 bucket data.
Sources
Use Data Catalog views in Athena - Amazon Athena
Manage Lake Formation and Athena user permissions - Amazon Athena

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.