Azure Network Table

This page shows how to write Terraform and Azure Resource Manager for Network Table and write them securely.

azurerm_route_table (Terraform)

The Table in Network can be configured in Terraform with the resource name azurerm_route_table. The following sections describe 7 examples of how to use the resource and its parameters.

Example Usage from GitHub

route_table.tf#L1
resource "azurerm_route_table" "DMZ1RT" {
  name                = "DMZ1RT"
  location            = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name

  route {
routeTables.tf#L2
resource "azurerm_route_table" "makissubnet-udr" {
  name                          = "makissubnet-udr"
  location                      = "europe"
  resource_group_name           = "my-rg"
  disable_bgp_route_propagation = false
  route {
routes.tf#L1
resource "azurerm_route_table" "PAN_FW_RT_Trust" {
  name                = var.routeTableTrust
  location            = data.terraform_remote_state.vnet.outputs.resource_group_location
  resource_group_name = data.terraform_remote_state.vnet.outputs.resource_group_name

  route {
fgt-routes.tf#L2
resource "azurerm_route_table" "dmz" {
  name                = "DMZRouteTable"
  location            = azurerm_resource_group.resource_group.location
  resource_group_name = azurerm_resource_group.resource_group.name
  route = [
  {
route_table.tf#L1
resource "azurerm_route_table" "DMZ1RT" {
  name                = "DMZ1RT"
  location            = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name

  route {
vnet.tf#L21
resource "azurerm_route_table" "sandbox1subnet1rt" {
  name                = "sandbox1subnet1-routetable"
  location                  = azurerm_resource_group.transithub.location
  resource_group_name       = azurerm_resource_group.transithub.name

  route {
rutas.tf#L40
resource "azurerm_route_table" "rtFrontend" {
  name                          = "rtFrontend"
  location = var.loc
  resource_group_name           = var.rgfirewall
  disable_bgp_route_propagation = true
/*

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Route Table

NOTE on Route Tables and Routes: Terraform currently provides both a standalone Route resource, and allows for Routes to be defined in-line within the Route Table resource. At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes.

Tips: Best Practices for The Other Azure Network Resources

In addition to the azurerm_network_security_group, Azure Network has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

azurerm_network_security_group

Ensure to disable RDP port from the Internet

It is better to disable the RDP port from the Internet. RDP access should not be accepted from the Internet (*, 0.0.0.0, /0, internet, any), and consider using the Azure Bastion Service.

risk-label

azurerm_network_security_rule

Ensure to set a more restrictive CIDR range for ingress from the internet

It is better to set a more restrictive CIDR range not to use very broad subnets. If possible, segments should be divided into smaller subnets.

risk-label

azurerm_network_watcher_flow_log

Ensure to enable Retention policy for flow logs and set it to enough duration

It is better to enable a retention policy for flow logs. Flow logs show us all network activity in the cloud environment and support us when we face critical incidents.

Review your Azure Network settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Microsoft.Network/routeTables (Azure Resource Manager)

The routeTables in Microsoft.Network can be configured in Azure Resource Manager with the resource name Microsoft.Network/routeTables. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

azuredeploy.json#L22
            "type": "Microsoft.Network/routeTables",
            "apiVersion": "2019-06-01",
            "name": "[parameters('route_table_name')]",
            "location": "[parameters('location')]",
            "properties": {
                "disableBgpRoutePropagation": false,
routeTables.route.azuredeploy.json
{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "fw-internal-ip":{
udr.json#L17
            "type": "Microsoft.Network/routeTables",
            "location": "[resourceGroup().location]",
            "properties": {
                "disableBgpRoutePropagation": false,
                "routes": [
                    {
udr.json#L17
            "type": "Microsoft.Network/routeTables",
            "location": "[resourceGroup().location]",
            "properties": {
                "disableBgpRoutePropagation": false,
                "routes": [
                    {
udr.json#L17
            "type": "Microsoft.Network/routeTables",
            "location": "[resourceGroup().location]",
            "properties": {
                "disableBgpRoutePropagation": false,
                "routes": [
                    {
ForceTunnelingUDRs.json#L13
            "type": "Microsoft.Network/routeTables",
            "apiVersion": "2019-11-01",
            "name": "[parameters('routeTables')]",
            "location": "westeurope",
            "tags": {
                "ManagedBy": "v-ololim"
route-table-template.json#L76
            "type": "Microsoft.Network/routeTables",
            "apiVersion": "2018-12-01",
            "name": "[variables('RT-rda-name')]",
            "location": "[parameters('location')]",
            "tags": {
                "Project": "GRS"
neUDRempty.json#L63
      "type": "Microsoft.Network/routeTables",
      "name": "[parameters('GatewayRouteTableName')]",
      "location": "[parameters('location')]",
      "tags": {
        "displayName": "Route Table - Gateway Subnet"
      },
weUDRempty.json#L63
      "type": "Microsoft.Network/routeTables",
      "name": "[parameters('GatewayRouteTableName')]",
      "location": "[parameters('location')]",
      "tags": {
        "displayName": "Route Table - Gateway Subnet"
      },
route-table-template.json#L76
            "type": "Microsoft.Network/routeTables",
            "apiVersion": "2018-12-01",
            "name": "[variables('RT-rda-name')]",
            "location": "[parameters('location')]",
            "tags": {
                "Project": "GRS"

Parameters

  • name required - string
  • type required - string
  • apiVersion required - string
  • location required - string

    Resource location.

  • tags optional - string

    Resource tags.

  • properties required
      • routes optional array
          • properties optional
              • addressPrefix required - string

                The destination CIDR to which the route applies.

              • nextHopType required - string

                The type of Azure hop the packet should be sent to.

              • nextHopIpAddress optional - string

                The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.

              • hasBgpOverride optional - boolean

                A value indicating whether this route overrides overlapping BGP routes regardless of LPM.

          • name optional - string

            The name of the resource that is unique within a resource group. This name can be used to access the resource.

      • disableBgpRoutePropagation optional - boolean

        Whether to disable the routes learned by BGP on that route table. True means disable.

Frequently asked questions

What is Azure Network Table?

Azure Network Table is a resource for Network of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Network Table?

For Terraform, the rdarst/Terraform-CheckPoint_Azure-ScaleSet_R80.40, gertzakis/azure-udr-generator and hashicorp/workshop-consul-terraform-sync source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the suprithakashyap/Azure-devops, tgiorgio/eoe-grs and cbellee/azure-iac-examples source code examples are useful. See the Azure Resource Manager Example section for further details.