Skip to content

Instantly share code, notes, and snippets.

@agrajm
Created April 30, 2021 15:44
Show Gist options
  • Save agrajm/d938ba575a32cd0f35b5d148f901ed56 to your computer and use it in GitHub Desktop.
Save agrajm/d938ba575a32cd0f35b5d148f901ed56 to your computer and use it in GitHub Desktop.
# Route table: UDR for AKS Subnet to force traffic via Firewall
resource "azurerm_route_table" "rt" {
name = var.rt_name
location = azurerm_resource_group.core.location
resource_group_name = azurerm_resource_group.core.name
disable_bgp_route_propagation = false
route {
name = "kubenetfw_fw_r"
address_prefix = "0.0.0.0/0"
next_hop_type = "VirtualAppliance"
next_hop_in_ip_address = azurerm_firewall.fw.ip_configuration[0].private_ip_address
}
depends_on = [azurerm_firewall.fw]
}
resource "azurerm_subnet_route_table_association" "aks_subnet_association" {
subnet_id = azurerm_subnet.akssubnet.id
route_table_id = azurerm_route_table.rt.id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment