Athena Query timing out connecting to spill bucket

1

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 s3.us-west-2.amazonaws.com:443 [s3.us-west-2.amazonaws.com/52.218.204.48] failed: connect timed out]

2개 답변
2
수락된 답변

If your lambda is VPC enabled, can you create a VPC endpoint for S3 in your VPC - https://docs.aws.amazon.com/AmazonS3/latest/userguide/privatelink-interface-endpoints.html and https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html

Also check if the IAM role associated with the lambda function has the necessary permissions to access S3 - https://aws.amazon.com/premiumsupport/knowledge-center/lambda-execution-role-s3-bucket/

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

profile pictureAWS
전문가
답변함 2년 전
profile pictureAWS
전문가
Chris_G
검토됨 2년 전
  • 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 - https://docs.aws.amazon.com/athena/latest/ug/hive-metastore-iam-access-lambda.html

    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.

0

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

Solution: Add VPC Gateway Endpoint (Select com.amazonaws.us-west-2.s3) in Lambda associated VPC.

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠