Using multiple Virtual Private Cloud (VPC) networks for your application is required in many cases whether you need to use different AWS accounts or even within the same account. Setting up connectivity between the VPCs may be needed and using a Transit Gateway is an option.

VPC Peering is also another common approach to getting connectivity between multiple VPCs but it required point-to-point connections between each VPC pair and does not allow transitive routing. Using a Transit Gateway allows a Hub and Spoke architecture where you can setup fewer connections to allow multiple VPCs to talk.

Sulaiman Olubiyi shows how you can use Terraform to setup a Transit Gateway in AWS and allow resources in multiple VPCs to communicate with each other.