简体   繁体   English

AWS Athena - 从 Lambda 连接

[英]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.通过lambda function 在 aws athena 中连接/运行查询工作正常,但是当我使用 lambda 与 vpc 连接时,它会出现超时错误。 please suggest a solution to resolve this请提出一个解决方案来解决这个问题

Since your function is "in" a VPC, there are two options to enable access to Athena:由于您的 function 在 VPC 中,因此有两个选项可以启用对 Athena 的访问:

  • Place your function in private su.net (public will not work), and setup NAT gateway in a public su.net with correct route tables.将您的 function 放在私有 su.net中(公共将不起作用),并在具有正确路由表的公共 su.net 中设置NAT 网关 This way, your function will connect to Athena using NAT and subsequently, the inte.net.这样,您的 function 将使用 NAT 连接到 Athena,随后连接到 inte.net。
  • Create a VPC interface endpoint for Athena in your VPC.在您的 VPC 中为 Athena 创建一个VPC 接口终端节点 This does not require inte.net access, nor NAT.这不需要 inte.net 访问,也不需要 NAT。 Subsequently you can privately connect to Athena without leaving AWS.随后,您可以在不离开 AWS 的情况下下连接到 Athena。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM