exec.azurerm.resource.deployment

Azure Resource Manager (ARM) Resource Deployment Execution Module

New in version 1.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.resource.deployment.cancel(hub, ctx, name, resource_group, **kwargs)

New in version 1.0.0.

Cancel a deployment if in ‘Accepted’ or ‘Running’ state.

Parameters:
  • name – The name of the deployment to cancel.
  • resource_group – The resource group name assigned to the deployment.

CLI Example:

azurerm.resource.deployment.cancel testdeploy testgroup
idem_azurerm.exec.azurerm.resource.deployment.check_existence(hub, ctx, name, resource_group, **kwargs)

New in version 1.0.0.

Check the existence of a deployment.

Parameters:
  • name – The name of the deployment to query.
  • resource_group – The resource group name assigned to the deployment.

CLI Example:

azurerm.resource.deployment.check_existence testdeploy testgroup
idem_azurerm.exec.azurerm.resource.deployment.create_or_update(hub, ctx, name, resource_group, deploy_mode='incremental', debug_setting='none', deploy_params=None, parameters_link=None, deploy_template=None, template_link=None, **kwargs)

New in version 1.0.0.

Deploys resources to a resource group.

Parameters:
  • name – The name of the deployment to create or update.
  • resource_group – The resource group name assigned to the deployment.
  • deploy_mode – The mode that is used to deploy resources. This value can be either ‘incremental’ or ‘complete’. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources.
  • debug_setting – The debug setting of the deployment. The permitted values are ‘none’, ‘requestContent’, ‘responseContent’, or ‘requestContent,responseContent’. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations.
  • deploy_params – JSON string containing name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parameters_link property or the deploy_params property, but not both.
  • parameters_link – The URI of a parameters file. You use this element to link to an existing parameters file. Use either the parameters_link property or the deploy_params property, but not both.
  • deploy_template – JSON string of template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. Use either the template_link property or the deploy_template property, but not both.
  • template_link – The URI of the template. Use either the template_link property or the deploy_template property, but not both.

CLI Example:

azurerm.resource.deployment.create_or_update testdeploy testgroup
idem_azurerm.exec.azurerm.resource.deployment.delete(hub, ctx, name, resource_group, **kwargs)

New in version 1.0.0.

Delete a deployment.

Parameters:
  • name – The name of the deployment to delete.
  • resource_group – The resource group name assigned to the deployment.

CLI Example:

azurerm.resource.deployment.delete testdeploy testgroup
idem_azurerm.exec.azurerm.resource.deployment.export_template(hub, ctx, name, resource_group, **kwargs)

New in version 1.0.0.

Exports the template used for the specified deployment.

Parameters:
  • name – The name of the deployment to query.
  • resource_group – The resource group name assigned to the deployment.

CLI Example:

azurerm.resource.deployment.export_template testdeploy testgroup
idem_azurerm.exec.azurerm.resource.deployment.get(hub, ctx, name, resource_group, **kwargs)

New in version 1.0.0.

Get details about a specific deployment.

Parameters:
  • name – The name of the deployment to query.
  • resource_group – The resource group name assigned to the deployment.

CLI Example:

azurerm.resource.deployment.get testdeploy testgroup
idem_azurerm.exec.azurerm.resource.deployment.list_(hub, ctx, resource_group, **kwargs)

New in version 1.0.0.

List all deployments within a resource group.

CLI Example:

azurerm.resource.deployment.list testgroup
idem_azurerm.exec.azurerm.resource.deployment.operation_get(hub, ctx, operation, deployment, resource_group, **kwargs)

New in version 1.0.0.

Get a deployment operation within a deployment.

Parameters:
  • operation – The operation ID of the operation within the deployment.
  • deployment – The name of the deployment containing the operation.
  • resource_group – The resource group name assigned to the deployment.

CLI Example:

azurerm.resource.deployment.operation_get testoperation testdeploy testgroup
idem_azurerm.exec.azurerm.resource.deployment.operations_list(hub, ctx, name, resource_group, result_limit=10, **kwargs)

New in version 1.0.0.

List all deployment operations within a deployment.

Parameters:
  • name – The name of the deployment to query.
  • resource_group – The resource group name assigned to the deployment.
  • result_limit – The limit on the list of deployment operations. Defaults to 10.

CLI Example:

azurerm.resource.deployment.operations_list testdeploy testgroup
idem_azurerm.exec.azurerm.resource.deployment.validate(hub, ctx, name, resource_group, deploy_mode=None, debug_setting=None, deploy_params=None, parameters_link=None, deploy_template=None, template_link=None, **kwargs)

New in version 1.0.0.

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.

Parameters:
  • name – The name of the deployment to validate.
  • resource_group – The resource group name assigned to the deployment.
  • deploy_mode – The mode that is used to deploy resources. This value can be either ‘incremental’ or ‘complete’. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources.
  • debug_setting – The debug setting of the deployment. The permitted values are ‘none’, ‘requestContent’, ‘responseContent’, or ‘requestContent,responseContent’. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations.
  • deploy_params – JSON string containing name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parameters_link property or the deploy_params property, but not both.
  • parameters_link – The URI of a parameters file. You use this element to link to an existing parameters file. Use either the parameters_link property or the deploy_params property, but not both.
  • deploy_template – JSON string of template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. Use either the template_link property or the deploy_template property, but not both.
  • template_link – The URI of the template. Use either the template_link property or the deploy_template property, but not both.

CLI Example:

azurerm.resource.deployment.validate testdeploy testgroup