Performance and cost issues with TGW and VPCs in Big Enterprise

I’m in a large enterprise with 350+ AWS accounts. For many, we’ve mostly given each one its own account with its own VPC (most lift and shifted apps landed in one account and one VPC). VPCs are peered to TGW. Traffic in/out of VPC goes to GWLB endpoints for centralized inspection. We have centralized egress as well. Now that we’re deep into AWS, we’ve seen TGW is disproportionately expensive. Also the increased network hops from inspection in centralized VPC is leading to many apps having performance issues. Overall it’s left a bad taste in everybody’s mouth. Is our situation unusual? We’re thinking about adding VPC peerings between VPCs where it’s needed, and we’re coming up with some groupings to group multiple apps into the same VPC. I’m worried that many VPC peerings are going to make networking a mess. I’m starting to think that centralized multi-tenant VPCs with microsegmentation through subnets is the way to go instead. Break VPCs across security zones, and each app gets its own subnet. Any thoughts?


Related discussions:

Announcing Internet Protocol Version 6 (IPv6) support for EC2 Instances in Amazon Virtual Private Cloud (VPC) – Regional Expansion
AWS CloudFormation Supports Authoring Templates with Code References and Amazon VPC Peering
New to AWS: Would like to learn how to set up a lab - Questions!
Why VPC supports only 16~28 CIDR?
Use of assigning Public/Elastic ip address to an instance in the private subnet with no route to internet.
[VPC/VPN] Why do VPN details show 169.254 addresses?
VPC beginner, two instances communicating privately
Amazon Elasticsearch Service now supports VPC | Amazon Web Services
Is there value in getting Availability Zones synchronized across accounts?
Conditional DNS Forward in AWS
zsh prompt (ps1) for aws region/account/profile
Automated testing for AWS network config
NLB & PrivateLink now supports access over inter-region VPC peering
Shared VPCs in AWS
Direct Connect Gateway roadmap
Lightsail/S2 VPC or S3 for multiple static sites?
Why are there only 3 private subnet ranges?
Questions about dynamically standing up many ec2 instances with secure connections
VPC Traffic Mirroring – Capture & Inspect Network Traffic
AWS CDK Python
behind the scenes, what is an AWS load balancer made of?
Is there a way to dump the entire environment into a csv? (vpc, sgs, ec2 instances, subnets, the whole thing)
Understanding VPCs?
VPC ACL-rules made my sites randomly slow?
New AZ in ca-central-1 (Canada) region - skipped C?
Amazon Virtual Private Cloud (VPC) now supports Bring Your Own IPv6 Addresses (BYOIPv6)
I need to do subnetting of my resources because we're going to do VPC peering. Is there a subnetting for dummies out there?
Multi VPC architecture - Cost
Pull in VPC and Subnet IDs via CloudFormation
What is the difference between AWS DMS and mysqldump for MySQL database migration? When to choose one over the other?
Amazon EC2 adds Resource Identifiers and Tags for VPC Security Group Rules
How do you scope your VPCs?
Free tools/OS projects to create visual representations of your AWS resources
Quick question about global accelerator.
New – Amazon VPC Network Access Analyzer
Amazon VPC now supports an AWS-managed prefix list for Amazon CloudFront
CDK & Looping through VPC construct Subnets
Switch to VPC Endpoints from NAT Gateways to Reduce Bandwidth Charges
Amazon VPC IP Address Manager (IPAM) now manages IP Addresses in your network outside your AWS Organization
Get rid of NAT-Gateway charge?
Allow temporary access to EC2 that it's part of a Private Subnet
Internet Connectivity to EC2 in Private Subnet
Suggestions how to move sales order data from website VPC to separate database VPC and third party CRM
Networking costs killing the value proposition for RDS. Or am I just an idiot?
Best practices checklist
Setting proxy for containers on EKS with containered
AT GateWay inside VPC with CIDR smaller subnet ?
The real cost of RDS for serverless?
fck-nat worth it?
A Simple Office Building Analogy to understand AWS VPC !! You Won’t Forget :)
Aviatrix instead of NAT Gateways
When setting up the web server EC2 instance, the web server EC2 instance works for several hours, and then it fails instance status checks and website goes down. Why is that?
VPC Peering Connections: What happens when traffic arrives at a VPC with multiple route tables for the same destination?
AWS Tutorial - AWS DMS - Migrate data from MySQL to S3
What is AWS VPC | VPC in AWS | AWS VPC Tutorial for Beginners | Intellipaat
Last week I passed the AWS Solutions Architect Associate and nearly lost my dignity in the process!
Passed AWS Certified Solutions Architect Associate : 968/1000
Passed SSA Today
PASSED!!! AWS SAA-C01 on hour ago
VPC
IPSec over DirectConnect
The AWS VPC Cheat Sheet for Beginners
Free 7-hour AWS Networking Video Course + AWS Client VPN Tutorial
Need info regarding Adrian Cantrill's Course
Enable Encryption in SQL Server RDS without downtime?
Passed Networking Specialty
Confused about VPC!
Simulated Data center configuration training with AWS
Had a month to prepare for SAA, passed with 838
VPC CIDR overlapping doubt
aws questions
NACLs and SGs question
VPC endpoints
[PASS] Cleared AWS SAA-C03 – Here’s How I Did It + Tips
Looking for AWS Solutions Architect practice questions by chapter
AWS Mini Projects (another day, another mini project !!) Database Migration Service
High Available VPN version 1
Restrictions when getting started
VPC IPsec Limit?
AWS Database Migration Service (2016-03-16)
Migrating large (10TB+) MySQL DBs from onprem to RDS

Subnet sharing

https://docs.aws.amazon.com/whitepapers/latest/building-scalable-secure-multi-vpc-network-infrastructure/amazon-vpc-sharing.html

Similar situation eyeing doing the above with AWS IPAM.for subnet distribution and NACL/Routing rules to control segmentation and communication between workload subnets.

For the amount of VPCs, I think VPC peering will be a mess. You can’t elect a central VPC to act as a hub like Transit Gateway does because the routing is not transitive with peering:
“Amazon VPCs do not support transitive peering, meaning that you can’t communicate two VPCs that are not directly peered using a third VPC as transit. If you want all of your VPCs to communicate with each other using VPC peering, you will need to create 1:1 VPC peering connections between each of them. Alternatively, you can use AWS Transit Gateway or AWS Cloud WAN to act as a network transit hub.”
https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/vpc-peering.html

Our infrastructure is much smaller but the idea of shared VPCs is still relevant. We have one VPC per environment type or tier like nonprod, staging and prod. In each VPC, you can do micro-segmentation using subnets, security groups and/or a product like, for instance, Cisco Secure Workload. In our case, most of the applications are in Kubernetes clusters with Cilium Network Policies.

But you can keep specialized VPCs for some purposes as well.

I saw that subnet sharing had some big discussions like 5-7 years ago but it feels like nobody mentions it anymore based on all the Googling I’ve done. It also seems like there’s a lot of AWS services that still aren’t compatible with it. I’ve had hopes for that too, but I fear that it might be something they added but it didn’t live up to the hype. I’d like to understand a real setup where someone succeeded with it. I initially thought about doing “big multitenant centralized VPCs in a central account, and you share subnets out to the various app accounts”. But I kept asking my AWS account team if this made sense and the SA made it sound like subnet sharing isn’t meant to be used for everything across the board, and more just where it’s needed. But that may just be lack of experience on his part, I’m, not sure. When people are succeeded at VPC sharing, is it “peer to peer” subnet sharing between application VPCs just where it’s needed, or is it the highly centralized approach where subnet sharing is your standard approach?

How many NAU are you working with here? Direct peering at this scale quickly becomes a nightmare, especially if you introduce multi-region The mesh of connections becomes almost unintelligible and you’ll be struggling under the weight of the cognitive overhead. Avoid if you can.

I like using Shared VPC in my environment, but EVERYONE will chime in with “it has problems at scale”. You could carve out VPCs per security zone like you said, centralize their deployment and share them to the accounts for IAM/resource segmentation. Since this would all be in one VPC, traffic between those apps wouldn’t be running up your TGW bill. You’d only be paying for traffic that leaves the VPC to other security boundaries.

I don’t like segmentation by subnets, since it wastes a lot of internal IP space in your VPC. Do you not trust Security Groups to segment your access? I would lean on Security Groups for segmenting traffic and develop some like audit automation to make sure people are scoping their groups properly. Subnets would be useful if you need predictable CIDRs for those apps, but it’s ugly to architect if you have a lot of applications.

Lastly, at your scale, reach out to your account team. You almost certainly have a solutions architect assigned to your account. Tap them to help you architect out of this. Make them earn that money you pay them every month.

First off think about if you were managing Cisco devices for 350 networks and having to manage that. Upgrades and HA would kill you. So a TGW is inexpensive in comparison IMO.

I would look at Wan and see about performance.

What is inspecting traffic on ingress and egress?

I implemented shared subnets in our environment, very successfully. Happy to give you a tour if you want.

I’d go back to your account team and ask for an engagement with a specialist. Sounds like you are a decent sized AWS customer and they have the ability to pull in some really sharp folks for a meeting or two.

We went down this path with a shared vpc in a central account, we are roughly at 300 accounts as well, and we are planning to move away from it.

We are a lambda heavy shop and ran into lambda eni limits and AWS does not recommend shared vpcs anymore (at least to us).

ENI limits or NAUs? I’m always interested where we’ll run into issues with our shared vpcs.

I’m not sure what answer you’re after with the NAU question (I’m not from the network team)- we’ve allocated a number of /16’s in AWS IPAM, and I’m sure there’s more available. I agree subnet per app will waste IPs, but I guarantee security team will shut down the idea of completely deferring to app owners dictating network policy through SGs even if mature guardrails were in place (there’s not). Microsegmentation by subnets will help with central firewall policies. For VPC peering, I’m not thinking full mesh, but just applying where it’s needed to alleviate hotspots. Maybe that’s just worse because of inconsistent networking? I already have terraform managing all the networking. If Terraform is managing all the route tables for me, then shouldn’t that relieve the cognitive burden? Trying to better enumerate/articulate all the different pain points if we add more VPC peering. I’ve had discussions with my account team, but I don’t feel like I’ve gotten strong answers. Feels like they’re just saying group up our VPCs into larger buckets (but still decentralized approach), and do VPC peering or subnet sharing on a case by case where it’s needed. I just wonder if he just hasn’t seen it done any other way so he’s recommending what he’s comfortable with. Hoping to hear from a wide variety of perspectives.

Yeah that’s understandable… this is the problem TGW is meant to solve. Centralizing everything would hopefully simplify this. Palo Alto does inspection. Curious, why would WAN be more performant?

Yeah, that would be great. Don’t suppose you’ll be at re:Invent this year?

NAUs helps me understand the scale of your VPCs. How many VMs/ENIs are you dealing with?

Selective peering is worse because of the inconsistency. We have it in places in our environment due to costs and randomly it’ll cause some issues. Route tables aren’t that hard to manage, it’s at the human level of just understanding which things can/can’t route to each other. The whole reason I got into this role was because we’d get to a service launch and realize we can’t connect two things together because of network issues.

If you have a good case for subnet segmentation, keep it. I have an anemic allocation of private IP space from our IT networking team and have to be very conservative when building out networks, so we go for everything in large subnets and lean heavily on security groups. I did have to fight with security a little bit, but they just didn’t understand the cloud very well. Once I explained how it really worked, they were cool with the approach.

For a while, I had a strong account team who’d give me really direct answers. Lately it seems like they’re always hedging. Maybe you’re in the same boat.

Hell no. But we could jump on Zoom and I’ll share some anonymized diagrams. :slight_smile:

You probably won’t gain much if you are doing AWS VPC traffic - if it’s working on hybrid/on-prem you could gain.

How is your PA setup for performance? - have a look there. Make sure all the packet size MTU’s line up.

This is the correct response. Don’t reinvent the wheel, leverage the team your AWS bill already pays for.

Bring your design concerns and cost constraints to your AWS account team and ask for a workshop to unpack your architecture and needs, put it on them to help you derive a better pattern. Your Solutions Architects get paid to help you figure this out, and have an army of specialists to call on with deep experience helping other companies solve the same problem.

We did scale the Palo’s up after some bottlenecking issues. MTUs are a good point… not my wheelhouse, can please elaborate what you would do there? IIRC, we tested bypassing the Palo, and just going over TGW still had performance issues.

Let’s say tens of thousands for now. All the VPCs are provisioned with TGW peering, so they always all have routes to each other. The routes aren’t configured selectively. We rely on firewalls to handle restriction. So in my mind at least, I don’t see adding VPC peering and routing rules to next hop each specific VPC CIDR to each other shouldn’t create a problem. But maybe i dont understand?