saltext.azurerm.states.azurerm_network#

Azure Resource Manager Network State Module

New in version 2019.2.0.

maintainer:

<devops@eitr.tech>

maturity:

new

platform:

linux

configuration:

This module requires Azure Resource Manager credentials to be passed as a dictionary of keyword arguments to the connection_auth parameter in order to work properly. Since the authentication parameters are sensitive, it’s recommended to pass them to the states via pillar.

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 Pillar for Azure Resource Manager authentication:

azurerm:
    user_pass_auth:
        subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617
        username: fletch
        password: 123pass
    mysubscription:
        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

Example states using Azure Resource Manager authentication:

{% set profile = salt['pillar.get']('azurerm:mysubscription') %}
Ensure virtual network exists:
    azurerm_network.virtual_network_present:
        - name: my_vnet
        - resource_group: my_rg
        - address_prefixes:
            - '10.0.0.0/8'
            - '192.168.0.0/16'
        - dns_servers:
            - '8.8.8.8'
        - tags:
            how_awesome: very
            contact_name: Elmer Fudd Gantry
        - connection_auth: {{ profile }}

Ensure virtual network is absent:
    azurerm_network.virtual_network_absent:
        - name: other_vnet
        - resource_group: my_rg
        - connection_auth: {{ profile }}

Functions

load_balancer_absent(name, resource_group[, ...])

New in version 2019.2.0.

load_balancer_present(name, resource_group)

New in version 2019.2.0.

network_interface_absent(name, resource_group)

New in version 2019.2.0.

network_interface_present(name, ...[, tags, ...])

New in version 2019.2.0.

network_security_group_absent(name, ...[, ...])

New in version 2019.2.0.

network_security_group_present(name, ...[, ...])

New in version 2019.2.0.

public_ip_address_absent(name, resource_group)

New in version 2019.2.0.

public_ip_address_present(name, resource_group)

New in version 2019.2.0.

route_absent(name, route_table, resource_group)

New in version 2019.2.0.

route_present(name, address_prefix, ...[, ...])

New in version 2019.2.0.

route_table_absent(name, resource_group[, ...])

New in version 2019.2.0.

route_table_present(name, resource_group[, ...])

New in version 2019.2.0.

security_rule_absent(name, security_group, ...)

New in version 2019.2.0.

security_rule_present(name, access, ...[, ...])

New in version 2019.2.0.

subnet_absent(name, virtual_network, ...[, ...])

New in version 2019.2.0.

subnet_present(name, address_prefix, ...[, ...])

New in version 2019.2.0.

virtual_network_absent(name, resource_group)

New in version 2019.2.0.

virtual_network_present(name, ...[, ...])

New in version 2019.2.0.