states.azurerm.containerregistry.webhook

Azure Resource Manager (ARM) Container Registry Webhook State Module

New in version 3.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 configuration 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.containerregistry.webhook.absent(hub, ctx, name, registry_name, resource_group, connection_auth=None, **kwargs)

New in version 3.0.0.

Ensure a webhook does not exist in a container registry.

Parameters:
  • name – Name of the webhook.
  • registry_name – The name of the container registry.
  • resource_group – The name of the resource group to which the container registry belongs.
Ensure container registry webhook is absent:
    azurerm.containerregistry.webhook.absent:
        - name: testhook
        - registry_name: testrepo
        - resource_group: testgroup
idem_azurerm.states.azurerm.containerregistry.webhook.present(hub, ctx, name, registry_name, resource_group, service_uri, actions, custom_headers=None, status='enabled', scope=None, tags=None, connection_auth=None, **kwargs)

New in version 3.0.0.

Changed in version 4.0.0.

Ensure a container registry webhook exists.

Parameters:
  • name – The name of the webhook.
  • registry_name – The name of the container registry.
  • resource_group – The name of the resource group to which the container registry belongs.
  • service_uri – The service URI for the webhook to post notifications.
  • actions – The list of actions that trigger the webhook to post notifications. Possible values include ‘chart_delete’, ‘chart_push’, ‘delete’, ‘push’, and ‘quarantine’.
  • custom_headers – A dictionary of custom headers that will be added to the webhook notifications.
  • status – The status of the webhook at the time the operation was called. Possible values are ‘enabled’ and ‘disabled’.
  • scope – The scope of repositories where the event can be triggered. For example, foo:>>*<< means events for all tags under repository foo. foo:bar means events for foo:bar only. foo is equivalent to foo:latest. Empty means all events.
  • tags – A dictionary of strings can be passed as tag metadata to the object.

Example usage:

Ensure container registry webhook exists:
    azurerm.containerregistry.webhook.present:
        - name: testhook
        - registry_name: testrepo
        - resource_group: testgroup
        - service_uri: http://idem.eitr.tech/webhook
        - actions:
            - push
        - status: enabled
        - customer_headers:
            X-Custom-Header: idem
        - tags:
            how_awesome: very
            contact_name: Elmer Fudd Gantry