Table of Contents
- Introduction
- Rename Private Route Tables
- Create Public Route Table
- Associate Private Subnet to Database VPC
- Associate Private Subnet to Server VPC
- Associate Public Subnet to Server VPC
- Create Routes In Route Tables
Introduction
In our previous setups, we setup NAT Gateway and a Transit Gateway. We did not update our route table for both NAT Gateway and the Transit Gateway. Now we are going to setup three route tables. One private route table for database vpc, one private route table for sever (ECS) VPC and one public route table for server (ECS) VPC as well.
Once we're done setting up our route table, we will configure all necessary routes. When we created our VPC's, default route tables were created for both server (ECS) vpc and database (RDS) vpc. We are going to use those default VPC's as our private route tables. This means, we are going to create only one route table for server (ECS) VPC which we will use as our public route table. Let's quickly rename this default VPC's first.
Rename Private Route Tables
- Click on the edit button to edit the default route table for database vpc, provide the name private-items-database-vpc-rtb and click on save.
- Click on the edit button to edit the default route table for database vpc, provide the name private-items-server-vpc-rtb and click on save.
- Both route tables have been update successfully.
Create Public Route Table
Now we have renamed the default route table according to its use case. Now let's quickly create the public route table for server (ECS) vpc.
- Click on Create route table.
- Provide the public route table name public-items-server-vpc-rtb and click on Create route table.
- Now the public route table has also been created.
Associate Private Subnets to Database VPC
Now that all the route tables have been setup successfully, we are now going to associate their corresponding subnets to them. We will start by associating the database private subnets to its route table (private-items-database-vpc-rtb).
- Select private-items-database-vpc-rtb and click on Edit subnet associations.
- Select all subnets and click on Save associations.
- Confirm all six subnets are associated.
We've successfully associated all subnets to private-items-database-vpc-rtb. Now, lets continue by associating the private subnets to private-items-server-vpc-rtb.
Associate Private Subnets to Server VPC
- Select private-items-server-vpc-rtb and click on Edit subnet associations.
- Select all private subnets
- Click on Save associations.
- Confirm all private subnets are associated.
Associate Public Subnets to Server VPC
- Select public-items-server-vpc-rtb and click on Edit subnet associations.
- Select all private route tables and click on Save associations.
- Confirm all public subnets are associated.
Create Routes In Route Tables
Now that we have successfully associated all the subnets to their appropriate right table, we are going to continue by creating all the routes in the route table. We will:
- Create a route to the Internet Gateway
- Create route to the Transit Gateway
- Create route to the NAT Gateway
Create Route For private-items-server-vpc-rtb
- Select private-items-server-vpc-rtb and click on Edit routes
- Click on Add route
- Provide CIDR range 10.0.0.0/8 and click on Transit Gateway.
- Select items-server-vpc-tgw-attach
- Click on Add route again.
- Provide CIDR range 0.0.0.0/0 and select NAT Gateway
- Select items-server-ngw
- Click on Save changes
- Confirm routes has been added and its in Active state.
Create Route For public-items-server-vpc-rtb
- Click on Edit route
- Click on Add route
- Provide CIDR range 10.0.0.0/8 and select Transit Gateway
- Select items-server-vpc-tgw-attach
- Click on Add route again
- Provide CIDR Range 0.0.0.0/0 and select Internet Gateway
- Select items-server-igw
- Click on Save changes
- Confirm routes and have been updated and in Active state.
Create Route For private-items-database-vpc-rtb
- Select private-items-database-vpc-rtb and click on Edit routes
- Click on Add route
- Provide CIDR range 10.0.0.0/8 and click on Transit Gateway.
- Select items-database-vpc-tgw-attach
- Click on Save changes
- Route has successfully been added
Now that we have successfully setup all route tables and updated its routes, now, we are going to continue by creating all required security groups.