Configuring Transit Gateway

1 hour
  • 5 Learning Objectives

About this Hands-on Lab

In this lab, we will be creating an AWS Transit Gateway and connecting three VPCs together so communication can flow between each VPC.

The solution video will show you how to connect two of the three VPCs together, leaving the remaining VPC for you to do as an end-of-lab assignment.

To complete this lab, you will need an understanding of what an AWS Transit Gateway is, and what it is used for, as well as a familiarization of the AWS console.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create Transit Gateway Subnet in Each VPC Using a /28 Address Space

In this objective, you will be creating a new subnet in FirstVPC and SecondVPC to house the transit gateway attachment.

FirstVPC

VPC ID = FirstVPC
Subnet name = FirstVPC-TransitGateway
Availability Zone = us-east-1a
IPv4CIDR block = 10.0.2.0/28

SecondVPC

VPC ID = SecondVPC
Subnet name = SecondVPC-TransitGateway
Availability Zone = us-east-1a
IPv4CIDR block = 10.1.2.0/28
Create and Attach Transit Gateway to the New Subnet in Each VPC

In this objective, you will be creating a transit gateway. Once this has been created, you will then create transit gateway attachments and configure these for the newly created subnets in the FirstVPC and SecondVPC.

Use the following information for this objective:

  • Creating a transit gateway:
Name = Transit-Gateway-01
Description = Connectivity-VPC
  • FirstVPC transit gateway attachment:
Name = FirstVPC-TGW-Att
Transit gateway ID = Transit-Gateway01
Attachment type = VPC
VPC ID = FirstVPC
Subnet ID = FirstVPC-TransitGateway
  • SecondVPC transit gateway attachment:
Name = SecondVPC-TGW-Att
Transit gateway ID = Transit-Gateway01
Attachment type = VPC
VPC ID = SecondVPC
Subnet ID = SecondVPC-TransitGateway
Modify Routing Tables in Each VPC

Now that the transit gateway is created and the attachments have been configured with the newly created subnets in FirstVPC and SecondVPC; the private route tables need modifying to include a catch all route for the transit gateway.

FirstVPCRTPrivate

Destination = 0.0.0.0/0
Target = Transit Gateway - FirstVPC-TWG-Att

SecondVPCRTPrivate

Destination = 0.0.0.0/0
Target = Transit Gateway - SecondVPC-TWG-Att
Confirm Connectivity with Ping Test from EC2 Instances

Retrieve the private IP address for EC2Instance2 from either the EC2 console or the credentials section of the lab.

Using AWS System Manager – Fleet Manager open a session to EC2Instance1.

Ping between EC2Instance1 and EC2Instance2.

ThirdVPC – Optional Challenge

As previously mentioned, the ThirdVPC has been left for you to practice the configuration on your own.

Below is an outline of the steps you will need to take, please remember you can watch the solution video again if you are stuck on any of the steps. Good luck Cloud Gurus!

Create transit gateway subnet in ThirdVPC:

ThirdVPC

VPC ID = ThirdVPC
Subnet name = ThirdVPC-TransitGateway
Availability Zone = us-east-1a
IPv4CIDR block = 10.2.2.0/28

Create transit gateway attachment:

ThirdVPC

Name = ThirdVPC-TGW-Att
Transit gateway ID = Transit-Gateway01
Attachment type = VPC
VPC ID = ThirdVPC
Subnet ID = ThirdVPC-TransitGateway

Modify route table:

ThirdVPCRTPrivate

Destination = 0.0.0.0/0
Target = Transit Gateway - ThirdVPC-TWG-Att

Confirm connectivity

  • Confirm ping connectivity.

  • Retrieve the private IP address for EC2Instance2 from either the EC2 console or the credentials section of the lab.

  • Using AWS System Manager – Fleet Manager open a session to EC2Instance3.

  • Ping between EC2Instance3 and EC2Instance2.

Additional Resources

Windyfront air conditioning business has grown exponentially and the number of VPCs managed by the Cloud team has increased. The lead engineer has asked you to look at ways of reducing the number of peering connections, while still allowing each resources in each VPC to communicate. A future requirement will be to connect the corporate HQ on-site network to the AWS VPC infrastructure. You have decided to implement AWS Transit Gateway in your test account to investigate this technology further.

In this lab, you will be provided with three VPCs with an EC2 instances in each. You will work through the scenario to configure the AWS Transit Gateway and to attach the VPCs to the Transit Gateway.

You will be following the steps listed below to complete this lab:

  • Create a subnet in each VPC using a /28 address space
  • Create and attach an AWS Transit Gateway to the new subnets in the VPCs
  • Modify routing tables in the VPCs
  • Test ping between EC2 instances in different VPCs

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?