DEV Community

Oladipupo Abeeb Olanrewaju
Oladipupo Abeeb Olanrewaju

Posted on

AWS Route Table & Route

An AWS Route Table is a virtual table that contains a set of rules, called routes, that are used to determine where network traffic is directed. Route tables are associated with subnets in a VPC (Virtual Private Cloud) and are used to control the flow of traffic between subnets, the internet, and other networks.

Route tables can be modified to control the flow of traffic between subnets and to configure advanced network routing scenarios. For example, you can create a custom route that directs traffic to a virtual private gateway to enable communication between your VPC and an on-premises network.

Route tables are a critical component of AWS networking and are used to ensure that network traffic is directed to the correct destination.

AWS ROUTE

AWS Route is a service that enables you to create and manage routing rules for your Amazon Web Services (AWS) resources. AWS Route allows you to dynamically route incoming traffic to different AWS services or to external endpoints based on the content of the incoming request.

AWS Route is commonly used to manage traffic between different services within an AWS infrastructure, as well as between external endpoints and AWS services. For example, you can use AWS Route to route traffic to different EC2 instances based on the geographic location of the user requesting the content, or to direct traffic to different AWS services based on the type of request.

AWS ROUTE TABLE && ROUTE
Save the file and run terraform apply in the terminal to see the results.

/* AWS ROUTE TABLE */
resource "aws_route_table" "main_route_table" {
  vpc_id = aws_vpc.main_vpc.id

  tags = {
    Name = "main_rt"
  }
}
/* AWS ROUTE */
resource "aws_route" "main_route" {
  route_table_id         = aws_route_table.main_route_table.id
  destination_cidr_block = "0.0.0.0/0"
  gateway_id   =     aws_internet_gateway.main_internet_gateway.id
}
Enter fullscreen mode Exit fullscreen mode

Terraform paln

Terraform Apply

Top comments (0)