简体   繁体   English

是否可以使用 AWS Lambda 连接到外部 postgresql 数据库?

[英]Is it possible to use AWS Lambda to connect to an external postgresql database?

I am currently using Spring-boot to access an API that is able to change data within an postgresql database hosted on my machine.我目前正在使用 Spring-boot 访问 API,它能够更改我机器上托管的 postgresql 数据库中的数据。 I would like to upload the program to AWS Lambda and use lambda for queries.我想把程序上传到AWS Lambda,用lambda查询。 Is that possible?那可能吗?

An AWS Lambda function that is not connected to an Amazon VPC has full access to the Inte.net.连接到 Amazon VPC 的 AWS Lambda function 具有对 Inte.net 的完全访问权限。 So, if the database is accessible on the Inte.net, then the Lambda function would be able to access it.因此,如果数据库可在 Inte.net 上访问,则 Lambda function 将能够访问它。

If you wish to add additional security by restricting the IP address range that is allowed to access the database, you can place the Lambda function in a private su.net , then use a NAT Gateway or NAT Instance in a public su.net.如果您希望通过限制允许访问数据库的 IP 地址范围来增加额外的安全性,您可以将 Lambda function 放在私有 su.net中,然后在公共 su.net 中使用 NAT 网关或 NAT 实例。 Attach a static Elastic IP address to the NAT Gateway / NAT Instance and all requests from the Lambda function will come from that IP address.将 static弹性 IP 地址附加到 NAT 网关/NAT 实例,所有来自 Lambda function 的请求都将来自该 IP 地址。

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

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