AWS Lambda至Atlas [英] AWS Lambda To Atlas
问题描述
我想将我的Lambda函数连接到Mongo Atlas.一切正常,但是我需要将功能移到VPC内,以便可以使用Redis.
I want to connect my Lambda function to Mongo Atlas. It was all working fine but I needed to move my function inside a VPC so I could use redis.
现在,我无法连接到数据库. 我查看了VPC上的安全组,并添加了mongo db端口,但没有任何乐趣
Now I cannot connect to my database. I looked at the security group on the VPC and added the mongo db port but with no joy
此外-mongo IP白名单目前如下 0.0.0.0/0(包括您当前的IP地址)
Also - the mongo IP Whitelist is as follows for now 0.0.0.0/0 (includes your current IP address)
还有什么我应该尝试的吗?
Is there anything else I should try?
谢谢
推荐答案
我需要将功能移到VPC内,以便可以使用Redis.
I needed to move my function inside a VPC so I could use redis.
如果您是:
-
使用专用的MongoDB Atlas实例(即非共享实例M0,M2和M5集群).
Using dedicated MongoDB Atlas instances (i.e. not shared instances M0, M2 and M5 clusters).
而且,MongoDB Atlas部署托管在AWS上
And, the MongoDB Atlas deployment is hosted on AWS
Then, you could follow this instruction to set up VPC peering connection.
请注意,MongoDB Atlas支持与相同区域中的其他AWS VPC进行VPC对等. AWS不支持跨区域VPC对等.对于多区域群集,必须按区域创建VPC对等连接.
Please note that MongoDB Atlas supports VPC peering with other AWS VPCs in the same region. AWS does not support cross-region VPC peering. For multi-region clusters, you must create VPC peering connections per-region.
另请参见以下教程:介绍VPC凝视MongoDB Atlas
这篇关于AWS Lambda至Atlas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!