Lambda -> Atlas connection timeout (private subnet - peering)

301 views Asked by At

We have 1 Atlas cluster that is already peered to 1 VPC in 1 region (eu-west-1). This peering connection has worked fine for years. At the moment, I'm trying to setup another peering connection to another VPC we have in another region (eu-west-2).

The peering connection has been established fine (the latter one on the screenshot below):

enter image description here

...and the SG has been whitelisted...

enter image description here

So, as far as I'm aware, everything seems fine on the Atlas side of things.

In AWS, we have the VPC (vpc-0ac2d...) with an IPv4 CIDR of 172.16.0.0/16. The peering connection looks fine as well:

enter image description here

The VPC has 2 Route Tables associated with it; rt-main-pub & rt-main-priv. The former having 3 public subnets & the latter having 2 private subnets.

Public routes below:

enter image description here

...& private routes:

enter image description here

The NAT (nat-03b...) is sitting in the public subnet so all traffic routed through there to the IGW & hit the wider internet. Apart from IPs that fall within the range of the Atlas CIDR which are routed to the peering connection (pcx-0d7...)

I have a test lambda which is doing just some HTTP request which succeeds so I know that the NAT -> IGW setup is working.

enter image description here

^^ that's my lambda config. In the correct VPC & the 2 private subnets.

And the rules on the SG (sg-05782b...) are...

enter image description here

enter image description here

I've compared all this to the setup that we currently have & I really can't see any differences. Logically, this seems like it should work but the lambda connection times out to the cluster.

It's also worth nothing that I can connect fine to the cluster with the Mongo URI connection string that I'm using.

0

There are 0 answers