1 Answer
- Newest
- Most votes
- Most comments
0
Hello,
- Is the DocumentDB in the same default VPC?
- I assume you didn't touch the NACLs or the default route tables?
- Normally you should have connectivity between all subnets of a VPC by default. So it doesn't matter if the subnets are public or not (for prod, it is highly recommended to use private subnets for obvious security reasons).
- If you don't find the issue, maybe you could try to connect with an EC2 instance by following this guide: https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-ec2.html
answered a year ago
Relevant content
- asked a year ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
Hello Vincent,
DocumentDB is in the same VPC as lambda and my EC2s.
I didn't touch NACLs or route tables, note that EC2s and ELB and ASG were made using Elastic Beanstalk.
I am already able to connect to DocumentDB from my EC2s.
DocumentDB is in a public subnet, should I move it to a private one? I don't remember I saw this option when I created the cluster.
Thanks for your help.
Is your Lambda launched in the same subnet as your EC2 and using the same security groups? Does your Lambda have the right IAM permissions?
Update: I just find out that I can connect to DocumentDB if my lambda is both in a public or private subnet. It just need to be in a subnet. Does that means that Doc umentDB is in a public subnet too? Do you think this configuration is secure?
thanks