0
votes

In security group(inbound rules) of ec2 instance i have opened mongo port to security group of lambda function EC2 inbound rules screenshot

In lambda function also i have selected vpc,subnets and security group. Lambda vpc configuration screenshot

Also i have configured NAT gateway for vpc. Still i am not able to access mongodb

1

1 Answers

0
votes

You should enter the subnets in your VPC (which is used by your lambda function) to the security group.

e.g.

enter image description here

but in this case, change the 3306 to mongodb port e.g. 27017