- Newest
- Most votes
- Most comments
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:
-
Create a Data Catalog view using the
CREATE PROTECTED MULTI DIALECT VIEWstatement with theSECURITY DEFINERclause in Athena. -
Have a Lake Formation administrator grant
SELECTpermissions 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. -
Make sure the role that creates the view (the "Definer") has full
SELECTpermissions on all underlying tables referenced by the view. -
Ensure that your table's S3 location is registered as a Lake Formation data lake location.
-
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
Relevant content
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
