AWS Route Table, Regions, and Multiple Availability Zones
Tags: aws, devops, cloud, webdev
Published: 2023-05-11 12:30:51

In this article, we will discuss the AWS Route Table, AWS regions, and multiple availability zones and give an introduction to how they work and how to use them.

## Route Table

The route table contains the networking rules for the subnets in a VPC. A route table contains the target and destination for each network call. So the user can define who can reach whom. When a subnet is created, it’s automatically and implicitly attached to the main route table. Each subnet must be connected to the Route table. The best practice for the user is to categorize public and private subnets and create routing groups to use for each purpose. Each subnet can only be associated with one route table. But one route table can be attached to multiple subnets.

Each VPC comes with a main route table that can not be deleted. But users can create and associate new route tables according to their preferences. Also in each Route table, there is a local route for communication inside the VPC. The Route Table connects various entities in a VPC. It can be associated with subnets, internet gateways, and virtual private gateways. Route tables for IPv4 and IPv6 traffic are created separately.

There is a limit on how many Route tables you can create per VPC. Also, there is an upper limit to the number of routes in Route table.

## Destination

It’s where the traffic will go. It’s the [CIDR address](https://www.enablegeek.com/tutorial/what-is-the-range-of-ip-address/) of end nodes that can call the target. Example: 172.15.0.1/16 (some custom IP address), 0.0.0.0/0 (for allowing all IPv4 traffic), or simply a single IP address that can call the target. IPv4 and IPv6 are treated separately by the Route table.

The destination can’t be arbitrary. The destination IP addresses must be available to the VPC.

## Target

through which the traffic will go. It can be a local connection, an internet gateway, or virtual private gateway. If the target is some gateway, then the Route table is called the gateway route table.

There are fixed types of targets available. For example, internet gateway.

Table: An example of destination & target Route

| Destination| Target               |
|------------|----------------------|
|0.0.0.0/0   | igw-9821231012912321 |


## Overwriting Routes

One subnet can be assigned to multiple Routes. But the most specified routes are given preference. For example, all IPv4 internet traffic is 0.0.0.0/0. If it’s connected to an internet gateway, but if you use a route for 172.1.0.0/16 IPv4 to a different target, then this one will be applied rather than the 0.0.0.0/0 one.

## Managing Security Risk

Route table helps to identify and prevent various attacks with a few simple clicks. This creates an abstraction layer over all traffic in the [VPC](https://www.enablegeek.com/tutorial/what-is-vpc-in-aws-cloud-computing/) and helps the user to minimize risk.

The Gateway Route table is the Route table that has the gateway as the target. This kind our Route table can save a lot of hassle in emergency cases. For hacking and resource misusage, you can easily turn on/off the target connection in the Route table and test out any kind of failure.

## Regions and Multiple Availability Zones


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76n12397r54xuvs2r5lz.png)

Amazon EC2 is hosted over multiple regions over the globe. Here regions mean geographically separated areas. The regions are isolated from each other, This achieves the greatest possible fault tolerance and stability. The User has to choose a region before launching VPCs and instances. In case of rare failures, just a single area will be affected. Deploying to a specific region helps the people of that region to get to the server fast and provide a lightning-fast service.

Each region is subdivided into multiple Availability Zones. Each availability zone has its own power, cooling, and network system. So, it’s an isolated failure domain within the isolated regions, which provides safer data storage. Users are encouraged by AWS to launch instances into multiple AZs in case of rare failures. The subnets of each AZs are closer to each other, so they can communicate with low latency.

If necessary users can migrate from one availability zone to another zone using the AWS-provided backup facilities.

## Local Zones

Local zones are extensions of the AWS region. To deploy resources to the proximity of end users, sometimes local zones are preferred. Local zones have low latency for local users.

## Wavelength Zones

To use cutting-edge 5G communication technology, AWS provides Wavelength zones. Storage and computing are similar to standard resources, but communication is much faster for instances deployed in wavelength zones. But it’s not available in all Regions.

Wavelength zones are tied to a Region; it’s a logical extension of a Region. Application deployed to wavelength zones has ultra-low latency response. To use a Wavelength zone, the user must opt into that zone and deploy subnet and other resources in that zone.

In this article, we discussed Route tables to manage your inbound and outbound traffic in AWS. We also discussed AWS’s regions and multiple availability zones, and how to use them to get low latency. The more you learn about these, the more you can customize your AWS platform to manage security and serve the end users with minimal delay.