azurerm_resource#

Azure Resource Manager Resource Execution Module

New in version 2019.2.0.

maintainer:

<devops@eitr.tech>

maturity:

new

platform:

linux

configuration:

This module requires Azure Resource Manager credentials to be passed as keyword arguments to every function 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

saltext.azurerm.modules.azurerm_resource.resource_groups_list(**kwargs)[source]#

New in version 2019.2.0.

List all resource groups within a subscription.

CLI Example:

salt-call azurerm_resource.resource_groups_list
saltext.azurerm.modules.azurerm_resource.resource_group_check_existence(name, **kwargs)[source]#

New in version 2019.2.0.

Check for the existence of a named resource group in the current subscription.

Parameters:

name – The resource group name to check.

CLI Example:

salt-call azurerm_resource.resource_group_check_existence testgroup
saltext.azurerm.modules.azurerm_resource.resource_group_get(name, **kwargs)[source]#

New in version 2019.2.0.

Get a dictionary representing a resource group’s properties.

Parameters:

name – The resource group name to get.

CLI Example:

salt-call azurerm_resource.resource_group_get testgroup
saltext.azurerm.modules.azurerm_resource.resource_group_create_or_update(name, location, **kwargs)[source]#

New in version 2019.2.0.

Create or update a resource group in a given location.

Parameters:
  • name – The name of the resource group to create or update.

  • location – The location of the resource group. This value is not able to be updated once the resource group is created.

CLI Example:

salt-call azurerm_resource.resource_group_create_or_update testgroup westus
saltext.azurerm.modules.azurerm_resource.resource_group_delete(name, **kwargs)[source]#

New in version 2019.2.0.

Delete a resource group from the subscription.

Parameters:

name – The resource group name to delete.

CLI Example:

salt-call azurerm_resource.resource_group_delete testgroup
saltext.azurerm.modules.azurerm_resource.deployment_operation_get(operation, deployment, resource_group, **kwargs)[source]#

New in version 2019.2.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:

salt-call azurerm_resource.deployment_operation_get XXXXX testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployment_operations_list(name, resource_group, result_limit=10, **kwargs)[source]#

New in version 2019.2.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 – (Default: 10) The limit on the list of deployment operations.

CLI Example:

salt-call azurerm_resource.deployment_operations_list testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployment_delete(name, resource_group, **kwargs)[source]#

New in version 2019.2.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:

salt-call azurerm_resource.deployment_delete testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployment_check_existence(name, resource_group, **kwargs)[source]#

New in version 2019.2.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:

salt-call azurerm_resource.deployment_check_existence testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployment_create_or_update(name, resource_group, deploy_mode='incremental', debug_setting='none', deploy_params=None, parameters_link=None, deploy_template=None, template_link=None, **kwargs)[source]#

New in version 2019.2.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:

salt-call azurerm_resource.deployment_create_or_update testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployment_get(name, resource_group, **kwargs)[source]#

New in version 2019.2.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:

salt-call azurerm_resource.deployment_get testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployment_cancel(name, resource_group, **kwargs)[source]#

New in version 2019.2.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:

salt-call azurerm_resource.deployment_cancel testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployment_validate(name, resource_group, deploy_mode=None, debug_setting=None, deploy_params=None, parameters_link=None, deploy_template=None, template_link=None, **kwargs)[source]#

New in version 2019.2.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:

salt-call azurerm_resource.deployment_validate testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployment_export_template(name, resource_group, **kwargs)[source]#

New in version 2019.2.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:

salt-call azurerm_resource.deployment_export_template testdeploy testgroup
saltext.azurerm.modules.azurerm_resource.deployments_list(resource_group, **kwargs)[source]#

New in version 2019.2.0.

List all deployments within a resource group.

CLI Example:

salt-call azurerm_resource.deployments_list testgroup
saltext.azurerm.modules.azurerm_resource.subscriptions_list_locations(subscription_id=None, **kwargs)[source]#

New in version 2019.2.0.

List all locations for a subscription.

Parameters:

subscription_id – The ID of the subscription to query.

CLI Example:

salt-call azurerm_resource.subscriptions_list_locations XXXXXXXX
saltext.azurerm.modules.azurerm_resource.subscription_get(subscription_id=None, **kwargs)[source]#

New in version 2019.2.0.

Get details about a subscription.

Parameters:

subscription_id – The ID of the subscription to query.

CLI Example:

salt-call azurerm_resource.subscription_get XXXXXXXX
saltext.azurerm.modules.azurerm_resource.subscriptions_list(**kwargs)[source]#

New in version 2019.2.0.

List all subscriptions for a tenant.

CLI Example:

salt-call azurerm_resource.subscriptions_list
saltext.azurerm.modules.azurerm_resource.tenants_list(**kwargs)[source]#

New in version 2019.2.0.

List all tenants for your account.

CLI Example:

salt-call azurerm_resource.tenants_list
saltext.azurerm.modules.azurerm_resource.policy_assignment_delete(name, scope, **kwargs)[source]#

New in version 2019.2.0.

Delete a policy assignment.

Parameters:
  • name – The name of the policy assignment to delete.

  • scope – The scope of the policy assignment.

CLI Example:

salt-call azurerm_resource.policy_assignment_delete testassign         /subscriptions/bc75htn-a0fhsi-349b-56gh-4fghti-f84852
saltext.azurerm.modules.azurerm_resource.policy_assignment_create(name, scope, definition_name, **kwargs)[source]#

New in version 2019.2.0.

Create a policy assignment.

Parameters:
  • name – The name of the policy assignment to create.

  • scope – The scope of the policy assignment.

  • definition_name – The name of the policy definition to assign.

CLI Example:

salt-call azurerm_resource.policy_assignment_create testassign         /subscriptions/bc75htn-a0fhsi-349b-56gh-4fghti-f84852 testpolicy
saltext.azurerm.modules.azurerm_resource.policy_assignment_get(name, scope, **kwargs)[source]#

New in version 2019.2.0.

Get details about a specific policy assignment.

Parameters:
  • name – The name of the policy assignment to query.

  • scope – The scope of the policy assignment.

CLI Example:

salt-call azurerm_resource.policy_assignment_get testassign         /subscriptions/bc75htn-a0fhsi-349b-56gh-4fghti-f84852
saltext.azurerm.modules.azurerm_resource.policy_assignments_list_for_resource_group(resource_group, **kwargs)[source]#

New in version 2019.2.0.

List all policy assignments for a resource group.

Parameters:

resource_group – The resource group name to list policy assignments within.

CLI Example:

salt-call azurerm_resource.policy_assignments_list_for_resource_group testgroup
saltext.azurerm.modules.azurerm_resource.policy_assignments_list(**kwargs)[source]#

New in version 2019.2.0.

List all policy assignments for a subscription.

CLI Example:

salt-call azurerm_resource.policy_assignments_list
saltext.azurerm.modules.azurerm_resource.policy_definition_create_or_update(name, policy_rule, **kwargs)[source]#

New in version 2019.2.0.

Create or update a policy definition.

Parameters:
  • name – The name of the policy definition to create or update.

  • policy_rule – A dictionary defining the policy rule.

CLI Example:

salt-call azurerm_resource.policy_definition_create_or_update testpolicy '{...rule definition..}'
saltext.azurerm.modules.azurerm_resource.policy_definition_delete(name, **kwargs)[source]#

New in version 2019.2.0.

Delete a policy definition.

Parameters:

name – The name of the policy definition to delete.

CLI Example:

salt-call azurerm_resource.policy_definition_delete testpolicy
saltext.azurerm.modules.azurerm_resource.policy_definition_get(name, **kwargs)[source]#

New in version 2019.2.0.

Get details about a specific policy definition.

Parameters:

name – The name of the policy definition to query.

CLI Example:

salt-call azurerm_resource.policy_definition_get testpolicy
saltext.azurerm.modules.azurerm_resource.policy_definitions_list(hide_builtin=False, **kwargs)[source]#

New in version 2019.2.0.

List all policy definitions for a subscription.

Parameters:

hide_builtin – Boolean which will filter out BuiltIn policy definitions from the result.

CLI Example:

salt-call azurerm_resource.policy_definitions_list