Building user-defined routes
In our setup, we have two subnets—web and DB—and we need to apply different routing treatments to the DB subnet, ensuring it doesn’t have public internet access. To achieve this, we will create a custom route table and configure a default route with next-hop set to none, effectively blocking all traffic destined for the internet.
You’ll define the custom route table in the route_tables variable and deploy it within each region’s configuration. This will allow us to control the routing behavior and ensure the DB subnet has restricted access while the web subnet remains publicly accessible.
In this recipe, we will walk through how to use user-defined routes (UDRs) to control traffic routing within a subnet. These UDRs can be associated with specific subnets in Azure, allowing us to fine-tune routing and adjust forwarding behaviors as needed:
- Because the route table definition is the same for both regions...