Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why awswrangler.athena.read_sql_query needs glue:DeleteTable and glue:GetDatabase permissions? #3020

Open
ezitofilho opened this issue Nov 14, 2024 · 1 comment
Labels
question Further information is requested

Comments

@ezitofilho
Copy link

I'm trying to do a query that does the following:
import awswrangler as wr
df = wr.athena.read_sql_query(sql=sql_query database=database, s3_output=s3_query_output_path, ctas_approach=False)

When I try with ctas_approach=False, I get an error of lack of glue:GetDatabase permission. Without it, I get the error of: glue:DeleteTable

I'm running this code on AWS Lambda with layer arn:aws:lambda:eu-west-1:336392948345:layer:AWSSDKPandas-Python311:18

Is there anything I can do to avoid giving those permissions? I thought this issue was solved in this ticket: #782

Thanks.

@ezitofilho ezitofilho added the question Further information is requested label Nov 14, 2024
@jaidisido
Copy link
Contributor

jaidisido commented Nov 15, 2024

The Athena StartQueryExecution indeed requires glue:GetDatabase IAM permission.

When setting ctas_approach=True, a temporary ctas_table is created and is deleted at the end of the API call which does require a glue:DeleteTable permission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants