Access denied in a lambda accessing an athena´s table

0

Hi I have a lambda that try to do a simple select in a table(s3) of Athena, this lambda always is showing me access denied in results showed in log bucket, the lambdas has fullbaccesS3 fullaccess athena and fullaccess glue and kms, also administrator however the result is the same. Note the code works fine fronm python in localhost but do not like a lambda.

Ricardo
asked 6 months ago217 views
2 Answers
0

Hello.

Could you please share the error details?
Also, after executing Lambda, it may be possible to check the API history using CloudTrail etc. to see which IAM policy is missing.

profile picture
EXPERT
answered 6 months ago
  • Hi Riku thanks or answering I will eplore cloudtrail, lambda runs ok until the first get_query_execution, the log of athena shows this ; <Error> <Code>AccessDenied</Code> <Message>Access Denied</Message> <RequestId>CX93CATQQ659FSGY</RequestId> <HostId>mslLmZ+dcYi1sP3hnCjKUZk/1wTmnyC5IjhcGFy8hJSr5PoVo3rGrNcwCXA3EfhzZkfCbxakhdA=</HostId> </Error>, the lambda even generates the ID for the job or query.

0

Hi, Ricardo

You can check the IAM permissions policies to allow Athena query. Can you check lambda attached roles with the below link? And check the Athena permission if Athena have a permission to write S3 bucket for query result.

https://docs.aws.amazon.com/athena/latest/ug/federated-query-iam-access.html

profile pictureAWS
answered 6 months 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.

Guidelines for Answering Questions