states.azurerm.network.local_network_gateway

Azure Resource Manager (ARM) Local Network Gateway 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.local_network_gateway.absent(hub, ctx, name, resource_group, connection_auth=None, **kwargs)

New in version 1.0.0.

Ensure a local network gateway object does not exist in the resource_group.

Parameters:
  • name – Name of the local network gateway object.
  • resource_group – The resource group associated with the local network gateway.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure local network gateway absent:
    azurerm.network.local_network_gateway.absent:
        - name: gateway1
        - resource_group: group1
idem_azurerm.states.azurerm.network.local_network_gateway.present(hub, ctx, name, resource_group, gateway_ip_address, bgp_settings=None, address_prefixes=None, fqdn=None, tags=None, connection_auth=None, **kwargs)

New in version 1.0.0.

Changed in version 4.0.0.

Ensure a location network gateway exists.

Parameters:
  • name – Name of the local network gateway.
  • resource_group – The resource group assigned to the local network gateway.
  • gateway_ip_address – IP address of local network gateway.
  • bgp_settings

    A dictionary representing a valid BgpSettings object, which stores the local network gateway’s BGP speaker settings. Valid parameters include:

    • asn: (Required) The BGP speaker’s Autonomous System Number. This is an integer value.
    • bgp_peering_address: (Required) The BGP peering address and BGP identifier of this BGP speaker. This is a string value.
    • peer_weight: (Optional) The weight added to routes learned from this BGP speaker. This is an Integer value.
  • address_prefixes – A list of address blocks reserved for this virtual network in CIDR notation. Serves as the local network gateway’s site address space.
  • fqdn – The FQDN of local network gateway.
  • tags – A dictionary of strings can be passed as tag metadata to the local network gateway object.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure local network gateway exists:
    azurerm.network.local_network_gateway.present:
        - name: gateway1
        - resource_group: rg-module-testing
        - gateway_ip_address: 192.168.0.1
        - bgp_settings:
            asn: 65515
            bgp_peering_address: 10.2.2.2
            peer_weight: 0
        - address_prefixes:
            - '10.0.0.0/8'
            - '192.168.0.0/16'
        - tags:
            contact_name: Elmer Fudd Gantry