[英]How to configured Default VPC IN AWS?
i want to send mail using node mailer in NodeJS if my lambda function is developed in default VPC because I have to access RDS too from the lambda function.如果我的 lambda 函数是在默认 VPC 中开发的,我想在 NodeJS 中使用节点邮件程序发送邮件,因为我也必须从 lambda 函数访问 RDS。
I am unable to send success mail for data successfully inserted in RDS if I deployed my lambda function in default VPC WHAT changes I need to do so I can send.如果我在默认 VPC 中部署了我的 lambda 函数,我将无法为成功插入 RDS 的数据发送成功邮件,我需要做哪些更改以便我可以发送。
IF I choose NO vpc then I am unable to set data to database.如果我选择 NO vpc,则无法将数据设置到数据库。
From https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html ,从https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html ,
When you connect a function to a VPC in your account, it does not have access to the internet unless your VPC provides access.当您将功能连接到您账户中的 VPC 时,除非您的 VPC 提供访问权限,否则它无法访问 Internet。
I take this to mean that if you wish to access both RDS and the internet from lambda from within your VPC, you need a NAT gatway (or to spin up your own instance).我认为这意味着如果您希望从 VPC 内的 lambda 访问 RDS 和互联网,您需要一个 NAT 网关(或启动您自己的实例)。 In other words, lambda does not support internet access with a public IP through an Internet Gateway, which is the mechanism of internet access within your vpc.换句话说,lambda 不支持通过 Internet 网关使用公共 IP 访问 Internet,这是您 vpc 内 Internet 访问的机制。
If you don't mind the cost, about 4.5 cents an hour plus data transfer last I checked, the simplest solution is probably:如果你不介意成本,加上我上次检查的数据传输大约每小时 4.5 美分,最简单的解决方案可能是:
This essentially creates a connection to the internet in that VPC without your lambda holding a Public IP address.这实质上会在该 VPC 中创建与 Internet 的连接,而您的 lambda 不会持有公共 IP 地址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.