exec.azurerm.containerinstance.group

Azure Resource Manager (ARM) Container Instance Group Execution Module

New in version 3.0.0.

maintainer:

<devops@eitr.tech>

configuration:

This module requires Azure Resource Manager credentials to be passed as keyword arguments to every function or via acct in order to work properly.

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
idem_azurerm.exec.azurerm.containerinstance.group.create_or_update(hub, ctx, name, resource_group, containers, os_type, restart_policy='OnFailure', identity=None, image_registry_credentials=None, ip_address=None, volumes=None, diagnostics=None, network_profile=None, dns_config=None, sku=None, encryption_properties=None, init_containers=None, tags=None, **kwargs)

New in version 3.0.0.

Create or update container groups with specified configurations. This is an EXTREMELY complex module. I wouldn’t recommend attempting to use this on the command line…

Consult the SDK documentation for more information about the objects passed to the parameters in this module.

Parameters:
  • name – The name of the container group.
  • resource_group – The name of the resource group to which the container group belongs.
  • containers

    A list of the containers within the container group. The following are possible parameters for the containers:

    • name: Required. The user-provided name of the container instance.
    • image: Required. The name of the image used to create the container instance.
    • resources:
      • requests:
        • memory_in_gb: Required. The memory request in GB of this container instance.
        • cpu: Required. The CPU request of this container instance.
        • gpu: The GPU request of this container instance.
      • limits:
        • memory_in_gb: The memory limit in GB of this container instance.
        • cpu: The CPU limit of this container instance.
        • gpu: The GPU limit of this container instance.
    • command: A list of commands to execute within the container instance in exec form.
    • ports: A list of the dictionaries of exposed ports on the container instance (i.e., {"protocol": "TCP", "port": 80}).
    • environment_variables: A list of environment variables to set in the container instance.
      • name: Required if environment_variables is used. The name of the environment variable.
      • value: The value of the environment variable.
      • secure_value: The value of the secure environment variable.
    • volume_mounts: A list of volume mounts available to the container instance.
      • name: Required if volume_mounts is used. The name of the volume mount.
      • mount_path: Required if volume_mounts is used. The path within the container where the volume should be mounted. Must not contain colon (:).
      • read_only: Boolean flag indicating whether the volume mount is read-only.
    • liveness_probe:
      • exec_property:
        • command: The commands to execute within the container.
      • http_get:
        • path: The path to probe.
        • port: Required if http_get is used. The port number to probe.
        • scheme: The scheme. Possible values include: ‘http’, ‘https’.
      • initial_delay_seconds: The initial delay seconds.
      • period_seconds: The period seconds.
      • failure_threshold: The failure threshold.
      • success_threshold: The success threshold.
      • timeout_seconds: The timeout seconds.
    • readiness_probe:
      • exec_property:
        • command: The commands to execute within the container.
      • http_get:
        • path: The path to probe.
        • port: Required if http_get is used. The port number to probe.
        • scheme: The scheme. Possible values include: ‘http’, ‘https’
      • initial_delay_seconds: The initial delay seconds.
      • period_seconds: The period seconds.
      • failure_threshold: The failure threshold.
      • success_threshold: The success threshold.
      • timeout_seconds: The timeout seconds.
  • os_type – The operating system type required by the containers in the container group. Possible values include: ‘Windows’, ‘Linux’.
  • restart_policy

    Restart policy for all containers within the container group. Possible values are:

    • Always: Always restart.
    • OnFailure: Restart on failure.
    • Never: Never restart.
  • identity – A dictionary defining a ContainerGroupIdentity object which represents the identity for the container group.
  • image_registry_credentials – A list of dictionaries defining ImageRegistryCredential objects for the image registry credentials.
  • ip_address

    A dictionary defining an IpAddress object which represents the IP address for the container group. Possible keys are:

    • ports: The list of ports exposed on the container group. Required if ip_address is used.
    • type: Specifies if the IP is exposed to the public internet or private VNET. Required if ip_address is used. Possible values include: ‘Public’, ‘Private’.
    • ip: The IP exposed to the public internet.
    • dns_name_label: The Dns name label for the IP.
  • volumes – The list of dictionaries representing Volume objects that can be mounted by containers in this container group.
  • diagnostics – A dictionary defining a ContainerGroupDiagnostics object which represents the diagnostic information for the container group.
  • network_profile – A dictionary defining a ContainerGroupNetworkProfile object which represents the network profile information for the container group.
  • dns_config – A dictionary defining a DnsConfiguration object which represents the DNS config information for the container group.
  • sku – The SKU for a container group. Possible values include: ‘Standard’, ‘Dedicated’
  • encryption_properties – A dictionary defining an EncryptionProperties object which represents the encryption properties for the container group.
  • init_containers – A list of dictionaries defining InitContainerDefinition objects which represent the init containers for the container group.
  • tags – The tags of the resource.
idem_azurerm.exec.azurerm.containerinstance.group.delete(hub, ctx, name, resource_group, **kwargs)

New in version 3.0.0.

Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes.

Parameters:
  • name – The name of the container group.
  • resource_group – The name of the resource group to which the container group belongs.

CLI Example:

azurerm.containerinstance.group.delete containergroup resourcegroup
idem_azurerm.exec.azurerm.containerinstance.group.get(hub, ctx, name, resource_group, **kwargs)

New in version 3.0.0.

Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.

Parameters:
  • name – The name of the container group.
  • resource_group – The name of the resource group to which the container group belongs.

CLI Example:

azurerm.containerinstance.group.get containergroup resourcegroup
idem_azurerm.exec.azurerm.containerinstance.group.list_(hub, ctx, resource_group=None, **kwargs)

New in version 3.0.0.

Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image container credentials, restart policy, IP address type, OS type, state, and volumes.

Parameters:resource_group – The name of the resource group to limit the results.

CLI Example:

azurerm.containerinstance.group.list
idem_azurerm.exec.azurerm.containerinstance.group.restart(hub, ctx, name, resource_group, **kwargs)

New in version 3.0.0.

Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.

Parameters:
  • name – The name of the container group.
  • resource_group – The name of the resource group to which the container group belongs.

CLI Example:

azurerm.containerinstance.group.restart containergroup resourcegroup
idem_azurerm.exec.azurerm.containerinstance.group.start(hub, ctx, name, resource_group, **kwargs)

New in version 3.0.0.

Starts all containers in a container group. Compute resources will be allocated and billing will start.

Parameters:
  • name – The name of the container group.
  • resource_group – The name of the resource group to which the container group belongs.

CLI Example:

azurerm.containerinstance.group.start containergroup resourcegroup
idem_azurerm.exec.azurerm.containerinstance.group.stop(hub, ctx, name, resource_group, **kwargs)

New in version 3.0.0.

Stops all containers in a container group. Compute resources will be deallocated and billing will stop.

Parameters:
  • name – The name of the container group.
  • resource_group – The name of the resource group to which the container group belongs.

CLI Example:

azurerm.containerinstance.group.stop containergroup resourcegroup
idem_azurerm.exec.azurerm.containerinstance.group.update(hub, ctx, name, resource_group, tags=None, **kwargs)

New in version 3.0.0.

Updates container group tags with specified values.

Parameters:
  • name – The name of the container group.
  • resource_group – The name of the resource group to which the container group belongs.
  • tags – The tags of the resource.

CLI Example:

azurerm.containerinstance.group.update containergroup resourcegroup tags='{"owner": "me"}'