states.azurerm.postgresql.server

Azure Resource Manager (ARM) PostgreSQL Server 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.postgresql.server.absent(hub, ctx, name, resource_group, connection_auth=None, **kwargs)

New in version 2.0.0.

Ensure a specified PostgreSQL Server does not exist.

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

Example usage:

Ensure server is absent:
    azurerm.postgresql.server.absent:
        - name: my_server
        - resource_group: my_rg
idem_azurerm.states.azurerm.postgresql.server.present(hub, ctx, name, resource_group, location, sku=None, version=None, ssl_enforcement=None, minimal_tls_version=None, infrastructure_encryption=None, public_network_access=None, storage_profile=None, login=None, login_password=None, force_password=False, tags=None, connection_auth=None, **kwargs)

New in version 2.0.0.

Changed in version 4.0.0.

Ensure a specified PostgreSQL Server exists.

Parameters:
  • name – The name of the server.
  • resource_group – The name of the resource group. The name is case insensitive.
  • location – The location the resource resides in.
  • sku – The name of the SKU (pricing tier) of the server. The name of the sku is in the form tier_family_cores, e.g. B_Gen4_1, GP_Gen5_8.
  • version – Server version. Possible values include: “9.5”, “9.6”, “10”, “10.0”, “10.2”, “11”.
  • ssl_enforcement – Enable ssl enforcement or not when connect to server. Possible values include: “Enabled”, “Disabled”.
  • minimal_tls_version – Enforce a minimal tls version for the server. Possible values include: “TLS1_0”, “TLS1_1”, “TLS1_2”, “TLSEnforcementDisabled”.
  • infrastructure_encryption – Status showing whether the server enabled infrastructure encryption. Possible values include: “Enabled”, “Disabled”.
  • public_network_access – Whether or not public network access is allowed for this server. Possible values include: “Enabled”, “Disabled”.
  • storage_profile

    A dictionary representing the storage profile of a server. Parameters include:

    • backup_retention_days: Backup retention days for the server.
    • geo_redundant_backup: Enable Geo-redundant or not for server backup. Possible values include: ‘Enabled’, ‘Disabled’.
    • storage_mb: Max storage allowed for a server.
    • storage_autogrow: Enable Storage Auto Grow. Possible values include: ‘Enabled’, ‘Disabled’.
  • login – The administrator’s login name of a server. This value is immutable once set.
  • login_password – The password of the administrator login.
  • force_password – An optional boolean flag that represents whether or not the password should be updated. If it is set to True, then the password will be updated if the server already exists. If it is set to False, then the password will not be updated unless other parameters also need to be updated. Defaults to False.
  • tags – A dictionary of strings can be passed as tag metadata to the server.
  • connection_auth – A dict with subscription and authentication parameters to be used in connecting to the Azure Resource Manager API.

Example usage:

Ensure server exists:
    azurerm.postgresql.server.present:
        - name: my_server
        - resource_group: my_rg
        - location: my_location
        - login: my_login
        - login_password: my_password
        - tags:
            contact_name: Elmer Fudd Gantry