states.azurerm.network.route

Azure Resource Manager (ARM) Network Route State Module

New in version 1.0.0.

Changed in version 4.0.0.

maintainer:

<devops@eitr.tech>

configuration:

This module requires Azure Resource Manager credentials to be passed via acct. Note that the authentication parameters are case sensitive.

Required provider parameters:

if using username and password:
  • subscription_id
  • username
  • password
if using a service principal:
  • subscription_id
  • tenant
  • client_id
  • secret

Optional provider parameters:

cloud_environment: Used to point the cloud driver to different API endpoints, such as Azure GovCloud. Possible values:

  • AZURE_PUBLIC_CLOUD (default)
  • AZURE_CHINA_CLOUD
  • AZURE_US_GOV_CLOUD
  • AZURE_GERMAN_CLOUD

Example acct setup for Azure Resource Manager authentication:

azurerm:
    default:
        subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617
        tenant: ABCDEFAB-1234-ABCD-1234-ABCDEFABCDEF
        client_id: ABCDEFAB-1234-ABCD-1234-ABCDEFABCDEF
        secret: XXXXXXXXXXXXXXXXXXXXXXXX
        cloud_environment: AZURE_PUBLIC_CLOUD
    user_pass_auth:
        subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617
        username: fletch
        password: 123pass

The authentication parameters can also be passed as a dictionary of keyword arguments to the connection_auth parameter of each state, but this is not preferred and could be deprecated in the future.

idem_azurerm.states.azurerm.network.route.absent(hub, ctx, name, route_table, resource_group, connection_auth=None, **kwargs)

New in version 1.0.0.

Ensure a route table does not exist in the resource group.

Parameters:
  • name – Name of the route table.
  • route_table – The name of the existing route table containing the route.
  • resource_group – The resource group assigned to the route table.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure route absent:
    azurerm.network.route.absent:
      - name: test_route
      - resource_group: test_group
idem_azurerm.states.azurerm.network.route.present(hub, ctx, name, route_table, resource_group, address_prefix, next_hop_type, next_hop_ip_address=None, connection_auth=None, **kwargs)

New in version 1.0.0.

Changed in version 4.0.0.

Ensure a route exists within a route table.

Parameters:
  • name – Name of the route.
  • route_table – The name of the existing route table which will contain the route.
  • resource_group – The resource group assigned to the route table.
  • address_prefix – The destination CIDR to which the route applies.
  • next_hop_type – The type of Azure hop the packet should be sent to. Possible values are: ‘VnetLocal’, ‘VirtualNetworkGateway’, ‘Internet’, ‘VirtualAppliance’, and ‘None’.
  • next_hop_ip_address – The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is ‘VirtualAppliance’.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure route exists:
    azurerm.network.route.present:
        - name: rt1_route2
        - route_table: rt1
        - resource_group: group1
        - address_prefix: '192.168.0.0/16'
        - next_hop_type: vnetlocal
idem_azurerm.states.azurerm.network.route.table_absent(hub, ctx, name, resource_group, connection_auth=None, **kwargs)

New in version 1.0.0.

Ensure a route table does not exist in the resource group.

Parameters:
  • name – Name of the route table.
  • resource_group – The resource group assigned to the route table.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure route table absent:
    azurerm.network.route.table_absent:
      - name: test_table
      - resource_group: test_group
idem_azurerm.states.azurerm.network.route.table_present(hub, ctx, name, resource_group, routes=None, disable_bgp_route_propagation=None, tags=None, connection_auth=None, **kwargs)

New in version 1.0.0.

Changed in version 4.0.0.

Ensure a route table exists.

Parameters:
  • name – Name of the route table.
  • resource_group – The resource group assigned to the route table.
  • routes – A list of dictionaries representing valid Route objects contained within a route table. See the documentation for the route_present state or route_create_or_update execution module for more information on required and optional parameters for routes. The routes are only managed if this parameter is present. When this parameter is absent, implemented routes will not be removed, and will merely become unmanaged.
  • disable_bgp_route_propagation – A boolean parameter setting whether to disable the routes learned by BGP on the route table.
  • tags – A dictionary of strings can be passed as tag metadata to the route table object.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure route table exists:
    azurerm.network.route.table_present:
        - name: rt1
        - resource_group: group1
        - routes:
          - name: rt1_route1
            address_prefix: '0.0.0.0/0'
            next_hop_type: internet
          - name: rt1_route2
            address_prefix: '192.168.0.0/16'
            next_hop_type: vnetlocal
        - tags:
            contact_name: Elmer Fudd Gantry