states.azurerm.redis.operations

Azure Resource Manager (ARM) Redis Operations State Module

New in version 2.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.redis.operations.absent(hub, ctx, name, resource_group, connection_auth=None, **kwargs)

New in version 2.0.0.

Ensure a Redis cache does not exist in the specified resource group.

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

Example usage:

Ensure redis cache does not exist:
    azurerm.redis.operations.absent:
        - name: my_redis_cache
        - resource_group: my_rg
idem_azurerm.states.azurerm.redis.operations.present(hub, ctx, name, resource_group, location, sku, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, minimum_tls_version=None, subnet_id=None, static_ip=None, zones=None, polling=True, poller_interval=60, poller_timeout=60, tags=None, connection_auth=None, **kwargs)

New in version 2.0.0.

Changed in version 4.0.0.

Ensure a redis cache exists in the resource group.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.
  • location – The geo-location where the resource lives.
  • sku

    A dictionary representing the SKU of the Redis cache to deploy. Required parameters include:

    • name: The type of Redis cache to deploy. Possible values include: ‘Basic’, ‘Standard’, and ‘Premium’.
    • family: The SKU family to use. Possible values include ‘C’ for Basic/Standard and ‘P’ for Premium.
    • capacity: The size of the Redis cache to deploy. Possible values include 0, 1, 2, 3, 4, 5, and 6 for the C (Basic/Standard) family and 1, 2, 3, and 4 for the P (Premium) family.
  • redis_configuration – A dictionary of string key-value pairs that represent all Redis Settings. Some possible keys include: rdb-backup-enabled, rdb-storage-connection-string, rdb-backup-frequency, maxmemory-delta, maxmemory-policy, notify-keyspace-events, maxmemory-samples, slowlog-log-slower-than, slowlog-max-len, list-max-ziplist-entries, list-max-ziplist-value, hash-max-ziplist-entries, hash-max-ziplist-value, set-max-intset-entries, zset-max-ziplist-entries, zset-max-ziplist-value, and more.
  • enable_non_ssl_port – Specifies whether the non-ssl Redis server port (6379) is enabled. Defaults to False.
  • tenant_settings – A dictionary of tenant settings.
  • shard_count – The number of shards to be created on a Premium Cluster Cache.
  • minimum_tls_version – The specified TLS version (or higher) that clients are required to use. Possible values include: ‘1.0’, ‘1.1’, and ‘1.2’.
  • subnet_id – The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1.
  • static_ip – Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network.
  • zones – A list of availability zones denoting where the resource needs to come from.
  • tags – A dictionary of strings can be passed as tag metadata to the Redis cache object.
  • polling – An optional boolean flag representing whether a Poller will be used during the creation of the Redis Cache. If set to True, a Poller will be used by this operation and the module will not return until the Redis Cache has completed its creation process and has been successfully provisioned. If set to False, the module will return once the Redis Cache has successfully begun its creation process. Due to an issue with polling within the most recent packages of azure-mgmt-redis, the poller_interval and poller_timeout parameters are used to assist with polling if this parameter is set to True. Defaults to True.
  • poller_interval – The number of seconds between every attempt of the state module to poll Azure and check if the Redis Cache has been successfully provisioned. This parameter must be an integer between 30 and 300. Defaults to 60.
  • poller_timeout – The number of minutes that the state module should attempt to poll Azure about the provisioning status of the Redis Cache before just returning the result of the execution. This parameter must be an integer between 30 and 120. Defaults to 45.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure redis cache exists:
    azurerm.redis.operations.present:
        - name: my_cache
        - resource_group: my_group
        - sku:
            name: 'Premium'
            family: 'P'
            capacity: 3
        - location: 'eastus'
        - tags:
            contact_name: Elmer Fudd Gantry