How to attach VPC's to a TGW with Terraform?

March 2021

Here I have to add my picture

As your startup company keeps growing faster than ever before and adopting the full range of cloud solutions it is time to build bigger.

After carefully reviewing the current accounts strategy and looking into future strategies the company has determined how to design the new networking configuration of their growing applications.

In order to adapt to the growing pressures, the company should consider the following:

As you finish reading these requirements you should have a good idea as to which AWS resource is most suitable for this infrastructure. If you were thinking about Transit Gateway, you are heading in the right direction. We will be discussing the reasons behind this approach throughout this article and conclude with building the design using Terraform. Vamos!

Diagram 1: AWS-TGW.

What is AWS Transit Gateway (TGW)?

A TGW is a virtual router (hub) that allows customer VPC’s to interconnect with on premise networks using a single gateway.

Let us review some of the great features that AWS-TGW offers:

Let us review AWS-TGW infrastructure architecture requirements:

Note - TGW does not support routing between VPC’s with overlapping CIDR-block


TGW implementation solves the complexities of implementing hybrid architecture design. As we can see TGW provides control over the network requirements and would satisfy the company’s growing demand.

Terraform: Templates-previews

Now it is time to get hands on building this infrastructure.

Find the Terraform repo and instructions for this project here

more information here

Functions, arguments and expressions of Terraform that were used in the above project:

I would like to give a big shout out to my mentor Derek Morgan. Thank you for all of your support all these months and for the amazing course "More Than Certified in Terraform" the best course out there. Link to the course here. If you want to connect with him and ask questions about his course, contact him via LinkedIn Derek Morgan or you can join the TechStudySlack channel here.