<p>Are they in the same VPC? If yes it should just work as the VPC CIDR route will take care of all the subnets intercommunication. </p>

CC BY-SA 4.0
2019-08-09T21:15:43.957Z
yes, they are on the same VPC, but if that is the case, then why do I need to connect private a public subnets? take into account I'm not using the default routing table. All subnets currently have their own routing table.
Manatax
CC BY-SA 4.0
2019-08-09T21:36:06.923Z
I see, I'm not connecting the private to the public, but the private to the NAT in the public...
Manatax
CC BY-SA 4.0
2019-08-09T21:09:04.387Z
2019-08-09T21:09:04.387Z
MLu
<p>I'm testing some cloudformation infrastructure templates, and I noticed that most of the examples include routing tables to connect private subnets to public subnets, but my question then is:</p>

<p>if two private subnets exist in different AZs (and are attached to individual routing tables) and the resources within them may need to access a resource on the other subnet (for example a private service on the subnet 1 accessing a database on the subnet 2)</p>

<ol>
<li><strong>Should I create a route to connect the two private subnets in each of their routing tables?</strong></li>
<li><strong>Would it be a better practice to attach both subnets to a single shared routing table (both CIDRs are contiguous)?</strong></li>
</ol>

CC BY-SA 4.0
2019-08-09T21:16:03.627Z
Both subnets are on the same VPC
Manatax
<amazon-web-services><networking>
aws - Connect two private subnets?
Manatax
# aws - Connect two private subnets?

(Asked by: username_0 on 2019-08-09)

I'm testing some cloudformation infrastructure templates, and I noticed that most of the examples include routing tables to connect private subnets to public subnets, but my question then is:

if two private subnets exist in different AZs (and are attached to individual routing tables) and the resources within them may need to access a resource on the other subnet (for example a private service on the subnet 1 accessing a database on the subnet 2)

1. **Should I create a route to connect the two private subnets in each of their routing tables?**
2. **Would it be a better practice to attach both subnets to a single shared routing table (both CIDRs are contiguous)?**

**Tags:** amazon-web-services, networking

> **Comments:**
> **username_0**: Both subnets are on the same VPC  

---

## 1 answers

### Answer by username_1 on 2019-08-09. Score: 2 | Accepted answer

Are they in the same VPC? If yes it should just work as the VPC CIDR route will take care of all the subnets intercommunication.

> **Comments:**
> **username_0**: yes, they are on the same VPC, but if that is the case, then why do I need to connect private a public subnets? take into account I'm not using the default routing table. All subnets currently have their own routing table.  
> **username_0**: I see, I'm not connecting the private to the public, but the private to the NAT in the public...  

---

