Muthuraman M
Muthuraman M

Reputation: 23

AWS Athena - Connect from Lambda

connecting/Running query in an aws athena via lambda function is working fine, but when i connect using lambda with vpc, it gives timeout error. please suggest a solution to resolve this

Upvotes: 2

Views: 1049

Answers (1)

Marcin
Marcin

Reputation: 238199

Since your function is "in" a VPC, there are two options to enable access to Athena:

  • Place your function in private subnet (public will not work), and setup NAT gateway in a public subnet with correct route tables. This way, your function will connect to Athena using NAT and subsequently, the internet.
  • Create a VPC interface endpoint for Athena in your VPC. This does not require internet access, nor NAT. Subsequently you can privately connect to Athena without leaving AWS.

Upvotes: 1

Related Questions