- Newest
- Most votes
- Most comments
No, you can't share a NAT Gateway via VPC Peering.
You can share a NAT Gateway when using Transit Gateway to link the VPCs together. However, there is additional cost there so that may not be an appropriate solution for you.
You could set up a proxy server in the first VPC and have applications in the second VPC access that proxy server and have it use the NAT Gateway. But again, that is additional cost and complexity for you so I wouldn't recommend that and it might not work for applications that can't be configured to use a proxy server.
As per previous answer you can't share a NAT Gateway via peering.
We have used transit gateways where we run multiple (~9) VPCs in a single account.
For us the cost savings make good sense and we can present a single set of 3x IP addresses for outbound egress.
No Transit Gateway
3x NAT Gateways (1 per AZ) x 9 VPCs @$0.059/hr = $1.593/hr = $1,146.96/month
Compared with
3x NAT Gateways @$0.059/hr = 0.177/hr = $127.44/month
9 x transit gateway attachments @$0.07/hr = $0.63/hr = $453.60/month
Of course this doesn't include data charges but these are not significant in our setup.
Relevant content
- asked a year ago
- asked 2 years ago
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
Adding the comment from official link as well. "If VPC A has an NAT device that provides internet access to subnets in VPC A, resources in VPC B can't use the NAT device in VPC A to access the internet." reference: https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-basics.html#vpc-peering-limitations