Athena Query timing out connecting to spill bucket


I just created my first lambda function using the AWS pre-written jdbc connector for PostgreSQL. It connects to my database but throws an exception when I run a query. I think it can't connect to my spill bucket but I don't know why. My DB is in us-west-2. Here is the error: GENERIC_USER_ERROR: Encountered an exception[com.amazonaws.SdkClientException] from your LambdaFunction[arn:aws:lambda:us-west-2:554283132974:function:lambdapostgresconnector] executed in context[retrieving meta-data] with message[Unable to execute HTTP request: Connect to [] failed: connect timed out]

2 Answers
Accepted Answer

If your lambda is VPC enabled, can you create a VPC endpoint for S3 in your VPC - and

Also check if the IAM role associated with the lambda function has the necessary permissions to access S3 -

Also if you are following any particular tutorial from AWS, can you please provide the URL?

profile pictureAWS
answered a year ago
profile pictureAWS
reviewed a year ago
  • I will try to create your suggestions. thank you so much!!

  • If your lambda function is failing when trying to execute an Athena query, then this document may also help you set the right permissions -

    If nothing works, please do share some more details on what you are trying to do and where exactly the failure is occuring

  • I had the same issue. I tried to create an S3 endpoint of the type interface and I couldn't make it work.

    Once I created an S3 endpoint of the type gateway it started working.


Root cause: VPC have no internet connection issue, causing Lambda can't access S3.

Solution: Add VPC Gateway Endpoint (Select in Lambda associated VPC.

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.

Guidelines for Answering Questions