简体   繁体   English

AWS Lambda连接到VPC中的RDS的潜在替代方案

[英]AWS Lambda potential alternatives to connect to RDS in VPC

I am using a lambda function in a VPC to connect to an RDS instance in the same VPC. 我在VPC中使用Lambda函数连接到同一VPC中的RDS实例。 I am considering removing the lambda from the VPC to massively reduce the cold-start time but I want to keep my RDS instance in the VPC. 我正在考虑从VPC中删除lambda,以大大减少冷启动时间,但我想将RDS实例保留在VPC中。

Can anyone foresee major problems with making the lambda function use an SSH tunnel to connect to a bastion instance within the VPC and subsequently to the RDS instance? 任何人都可以预见到使lambda函数使用SSH隧道连接到VPC内的堡垒实例以及随后的RDS实例的主要问题吗? Or something similar with a VPN? 还是类似VPN?

There will obviously be some over-head as the traffic has an extra 'jump' so to speak, but would it be significant enough to make this approach non-feasible? 可以这么说,因为流量有一个额外的“跳跃”,显然会有一些开销,但是是否足以使这种方法不可行呢? Or is the only current approach to keep the Lambda in the same VPC and try to keep and few invocations running? 还是当前唯一的方法是将Lambda保持在同一VPC中并尝试保持少量调用运行?

I also pay for a NAT gateway so my Lambda in a VPC can access the internet. 我还为NAT网关付费,这样我在VPC中的Lambda可以访问互联网。 If I can get it out of the VPC by using an SSH tunnel to connect to the RDS instance it will also simplify my architecture here & reduce my operating costs. 如果我可以通过使用SSH隧道连接到RDS实例将其从VPC中删除,那么这还将简化我的体系结构并降低我的运营成本。

Cold starts because of Lambda's in VPC are a big issue, especially when you want to use a relational database. 由于VPC中存在Lambda,冷启动是一个大问题,尤其是当您要使用关系数据库时。 Luckily, AWS has acknowledged this issue and there is hope on the horizon; 幸运的是,AWS已经意识到了这个问题,并且希望很快就会出现。

  • Aurora Serverless now supports the Data API that allows to run SQL queries using the AWS SDK over https. Aurora Serverless现在支持数据API,该API允许通过AWS开发工具包通过https运行SQL查询。 This is released on Nov 20 ('18) and is in beta and only in us-east-1, but it's a start. 该版本于11月20日('18)发布,目前处于Beta测试阶段,仅在us-east-1中发布,但这只是一个开始。
  • During re:Invent '18 an improvement on the VPC-cold-start issue was announced (but no release date yet) in which they basically create an ENI for a group of Lambda's and have that ENI ready even if there are no Lambda's warm. 在re:Invent '18期间,宣布了对VPC冷启动问题的改进(但尚未发布日期),其中他们基本上为一组Lambda创建了一个ENI,即使没有Lambda的热身,也已经准备好该ENI。

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

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