states.azurerm.compute.availability_set

Azure Resource Manager (ARM) Compute Availability Set 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.compute.availability_set.absent(hub, ctx, name, resource_group, connection_auth=None, **kwargs)

New in version 1.0.0.

Ensure an availability set does not exist in a resource group.

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

Example usage:

Ensure availability set absent:
    azurerm.compute.availability_set.absent:
        - name: test_set
        - resource_group: test_group
idem_azurerm.states.azurerm.compute.availability_set.present(hub, ctx, name, resource_group, tags=None, platform_update_domain_count=None, platform_fault_domain_count=None, virtual_machines=None, sku=None, proximity_placement_group=None, connection_auth=None, **kwargs)

New in version 1.0.0.

Changed in version 4.0.0.

Ensure an availability set exists.

Parameters:
  • name – Name of the availability set.
  • resource_group – The resource group assigned to the availability set.
  • tags – A dictionary of strings can be passed as tag metadata to the availability set object.
  • platform_update_domain_count – An optional parameter which indicates groups of virtual machines and underlying physical hardware that can be rebooted at the same time.
  • platform_fault_domain_count – An optional parameter which defines the group of virtual machines that share a common power source and network switch.
  • virtual_machines – A list of names of existing virtual machines to be included in the availability set.
  • sku – The availability set SKU, which specifies whether the availability set is managed or not. Possible values are ‘Aligned’ or ‘Classic’. An ‘Aligned’ availability set is managed, ‘Classic’ is not.
  • proximity_placement_group – The resource ID of the proximity placement group that the availability set should be assigned to.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure availability set exists:
    azurerm.compute.availability_set.present:
        - name: aset1
        - resource_group: group1
        - platform_update_domain_count: 5
        - platform_fault_domain_count: 3
        - sku: aligned
        - tags:
            contact_name: Elmer Fudd Gantry