saltext.azurerm.states.azurerm_dns#

Azure Resource Manager DNS State Module

New in version 3000.

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 DNS zone exists:
    azurerm_dns.zone_present:
        - name: contoso.com
        - resource_group: my_rg
        - tags:
            how_awesome: very
            contact_name: Elmer Fudd Gantry
        - connection_auth: {{ profile }}

Ensure DNS record set exists:
    azurerm_dns.record_set_present:
        - name: web
        - zone_name: contoso.com
        - resource_group: my_rg
        - record_type: A
        - ttl: 300
        - arecords:
          - ipv4_address: 10.0.0.1
        - tags:
            how_awesome: very
            contact_name: Elmer Fudd Gantry
        - connection_auth: {{ profile }}

Ensure DNS record set is absent:
    azurerm_dns.record_set_absent:
        - name: web
        - zone_name: contoso.com
        - resource_group: my_rg
        - record_type: A
        - connection_auth: {{ profile }}

Ensure DNS zone is absent:
    azurerm_dns.zone_absent:
        - name: contoso.com
        - resource_group: my_rg
        - connection_auth: {{ profile }}

Functions

record_set_absent(name, zone_name, ...[, ...])

New in version 3000.

record_set_present(name, zone_name, ...[, ...])

New in version 3000.

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

New in version 3000.

zone_present(name, resource_group[, etag, ...])

New in version 3000.