This page documents the language specification for the azure package. If you're looking for help working with the inputs, outputs, or functions of azure resources in a Pulumi program, please see the resource documentation for examples and API reference.

policy

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-azure repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-azurerm repo.

class pulumi_azure.policy.Assignment(resource_name, opts=None, description=None, display_name=None, enforcement_mode=None, identity=None, location=None, name=None, not_scopes=None, parameters=None, policy_definition_id=None, scope=None, __props__=None, __name__=None, __opts__=None)

Configures the specified Policy Definition at the specified Scope. Also, Policy Set Definitions are supported.

import pulumi
import pulumi_azure as azure

example_definition = azure.policy.Definition("exampleDefinition",
    policy_type="Custom",
    mode="All",
    display_name="my-policy-definition",
    policy_rule="""     {
    "if": {
      "not": {
        "field": "location",
        "in": "[parameters('allowedLocations')]"
      }
    },
    "then": {
      "effect": "audit"
    }
  }
""",
    parameters="""      {
    "allowedLocations": {
      "type": "Array",
      "metadata": {
        "description": "The list of allowed locations for resources.",
        "displayName": "Allowed locations",
        "strongType": "location"
      }
    }
  }
""")
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_assignment = azure.policy.Assignment("exampleAssignment",
    scope=example_resource_group.id,
    policy_definition_id=example_definition.id,
    description="Policy Assignment created via an Acceptance Test",
    display_name="My Example Policy Assignment",
    parameters="""{
  "allowedLocations": {
    "value": [ "West Europe" ]
  }
}
""")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – A description to use for this Policy Assignment. Changing this forces a new resource to be created.

  • display_name (pulumi.Input[str]) – A friendly display name to use for this Policy Assignment. Changing this forces a new resource to be created.

  • enforcement_mode (pulumi.Input[bool]) – Can be set to ‘true’ or ‘false’ to control whether the assignment is enforced (true) or not (false). Default is ‘true’.

Parameters
  • identity (pulumi.Input[dict]) – An identity block.

  • location (pulumi.Input[str]) – The Azure location where this policy assignment should exist. This is required when an Identity is assigned. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – The name of the Policy Assignment. Changing this forces a new resource to be created.

  • not_scopes (pulumi.Input[list]) – A list of the Policy Assignment’s excluded scopes. The list must contain Resource IDs (such as Subscriptions e.g. /subscriptions/00000000-0000-0000-000000000000 or Resource Groups e.g./subscriptions/00000000-0000-0000-000000000000/resourceGroups/myResourceGroup).

  • parameters (pulumi.Input[str]) – Parameters for the policy definition. This field is a JSON object that maps to the Parameters field from the Policy Definition. Changing this forces a new resource to be created.

  • policy_definition_id (pulumi.Input[str]) – The ID of the Policy Definition to be applied at the specified Scope.

  • scope (pulumi.Input[str]) – The Scope at which the Policy Assignment should be applied, which must be a Resource ID (such as Subscription e.g. /subscriptions/00000000-0000-0000-000000000000 or a Resource Group e.g./subscriptions/00000000-0000-0000-000000000000/resourceGroups/myResourceGroup). Changing this forces a new resource to be created.

The identity object supports the following:

  • principal_id (pulumi.Input[str]) - The Principal ID of this Policy Assignment if type is SystemAssigned.

  • tenant_id (pulumi.Input[str]) - The Tenant ID of this Policy Assignment if type is SystemAssigned.

  • type (pulumi.Input[str]) - The Managed Service Identity Type of this Policy Assignment. Possible values are SystemAssigned (where Azure will generate a Service Principal for you), or None (no use of a Managed Service Identity).

description: pulumi.Output[str] = None

A description to use for this Policy Assignment. Changing this forces a new resource to be created.

display_name: pulumi.Output[str] = None

A friendly display name to use for this Policy Assignment. Changing this forces a new resource to be created.

enforcement_mode: pulumi.Output[bool] = None
identity: pulumi.Output[dict] = None

An identity block.

  • principal_id (str) - The Principal ID of this Policy Assignment if type is SystemAssigned.

  • tenant_id (str) - The Tenant ID of this Policy Assignment if type is SystemAssigned.

  • type (str) - The Managed Service Identity Type of this Policy Assignment. Possible values are SystemAssigned (where Azure will generate a Service Principal for you), or None (no use of a Managed Service Identity).

location: pulumi.Output[str] = None

The Azure location where this policy assignment should exist. This is required when an Identity is assigned. Changing this forces a new resource to be created.

name: pulumi.Output[str] = None

The name of the Policy Assignment. Changing this forces a new resource to be created.

not_scopes: pulumi.Output[list] = None

A list of the Policy Assignment’s excluded scopes. The list must contain Resource IDs (such as Subscriptions e.g. /subscriptions/00000000-0000-0000-000000000000 or Resource Groups e.g./subscriptions/00000000-0000-0000-000000000000/resourceGroups/myResourceGroup).

parameters: pulumi.Output[str] = None

Parameters for the policy definition. This field is a JSON object that maps to the Parameters field from the Policy Definition. Changing this forces a new resource to be created.

policy_definition_id: pulumi.Output[str] = None

The ID of the Policy Definition to be applied at the specified Scope.

scope: pulumi.Output[str] = None

The Scope at which the Policy Assignment should be applied, which must be a Resource ID (such as Subscription e.g. /subscriptions/00000000-0000-0000-000000000000 or a Resource Group e.g./subscriptions/00000000-0000-0000-000000000000/resourceGroups/myResourceGroup). Changing this forces a new resource to be created.

static get(resource_name, id, opts=None, description=None, display_name=None, enforcement_mode=None, identity=None, location=None, name=None, not_scopes=None, parameters=None, policy_definition_id=None, scope=None)

Get an existing Assignment resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – A description to use for this Policy Assignment. Changing this forces a new resource to be created.

  • display_name (pulumi.Input[str]) – A friendly display name to use for this Policy Assignment. Changing this forces a new resource to be created.

  • enforcement_mode (pulumi.Input[bool]) – Can be set to ‘true’ or ‘false’ to control whether the assignment is enforced (true) or not (false). Default is ‘true’.

Parameters
  • identity (pulumi.Input[dict]) – An identity block.

  • location (pulumi.Input[str]) – The Azure location where this policy assignment should exist. This is required when an Identity is assigned. Changing this forces a new resource to be created.

  • name (pulumi.Input[str]) – The name of the Policy Assignment. Changing this forces a new resource to be created.

  • not_scopes (pulumi.Input[list]) – A list of the Policy Assignment’s excluded scopes. The list must contain Resource IDs (such as Subscriptions e.g. /subscriptions/00000000-0000-0000-000000000000 or Resource Groups e.g./subscriptions/00000000-0000-0000-000000000000/resourceGroups/myResourceGroup).

  • parameters (pulumi.Input[str]) – Parameters for the policy definition. This field is a JSON object that maps to the Parameters field from the Policy Definition. Changing this forces a new resource to be created.

  • policy_definition_id (pulumi.Input[str]) – The ID of the Policy Definition to be applied at the specified Scope.

  • scope (pulumi.Input[str]) – The Scope at which the Policy Assignment should be applied, which must be a Resource ID (such as Subscription e.g. /subscriptions/00000000-0000-0000-000000000000 or a Resource Group e.g./subscriptions/00000000-0000-0000-000000000000/resourceGroups/myResourceGroup). Changing this forces a new resource to be created.

The identity object supports the following:

  • principal_id (pulumi.Input[str]) - The Principal ID of this Policy Assignment if type is SystemAssigned.

  • tenant_id (pulumi.Input[str]) - The Tenant ID of this Policy Assignment if type is SystemAssigned.

  • type (pulumi.Input[str]) - The Managed Service Identity Type of this Policy Assignment. Possible values are SystemAssigned (where Azure will generate a Service Principal for you), or None (no use of a Managed Service Identity).

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.policy.AwaitableGetPolicyDefintionResult(description=None, display_name=None, id=None, management_group_id=None, management_group_name=None, metadata=None, name=None, parameters=None, policy_rule=None, policy_type=None, type=None)
class pulumi_azure.policy.AwaitableGetPolicySetDefinitionResult(description=None, display_name=None, id=None, management_group_name=None, metadata=None, name=None, parameters=None, policy_definitions=None, policy_type=None)
class pulumi_azure.policy.Definition(resource_name, opts=None, description=None, display_name=None, management_group_id=None, management_group_name=None, metadata=None, mode=None, name=None, parameters=None, policy_rule=None, policy_type=None, __props__=None, __name__=None, __opts__=None)

Manages a policy rule definition on a management group or your provider subscription.

Policy definitions do not take effect until they are assigned to a scope using a Policy Assignment.

import pulumi
import pulumi_azure as azure

policy = azure.policy.Definition("policy",
    display_name="acceptance test policy definition",
    metadata="""    {
    "category": "General"
    }


""",
    mode="Indexed",
    parameters="""      {
    "allowedLocations": {
      "type": "Array",
      "metadata": {
        "description": "The list of allowed locations for resources.",
        "displayName": "Allowed locations",
        "strongType": "location"
      }
    }
  }

""",
    policy_rule="""     {
    "if": {
      "not": {
        "field": "location",
        "in": "[parameters('allowedLocations')]"
      }
    },
    "then": {
      "effect": "audit"
    }
  }

""",
    policy_type="Custom")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – The description of the policy definition.

  • display_name (pulumi.Input[str]) – The display name of the policy definition.

  • management_group_name (pulumi.Input[str]) – The name of the Management Group where this policy should be defined. Changing this forces a new resource to be created.

  • metadata (pulumi.Input[str]) – The metadata for the policy definition. This is a json object representing additional metadata that should be stored with the policy definition.

  • mode (pulumi.Input[str]) – The policy mode that allows you to specify which resource types will be evaluated. The value can be “All”, “Indexed” or “NotSpecified”. Changing this resource forces a new resource to be created.

  • name (pulumi.Input[str]) – The name of the policy definition. Changing this forces a new resource to be created.

  • parameters (pulumi.Input[str]) – Parameters for the policy definition. This field is a json object that allows you to parameterize your policy definition.

  • policy_rule (pulumi.Input[str]) – The policy rule for the policy definition. This is a json object representing the rule that contains an if and a then block.

  • policy_type (pulumi.Input[str]) – The policy type. Possible values are BuiltIn, Custom and NotSpecified. Changing this forces a new resource to be created.

description: pulumi.Output[str] = None

The description of the policy definition.

display_name: pulumi.Output[str] = None

The display name of the policy definition.

management_group_name: pulumi.Output[str] = None

The name of the Management Group where this policy should be defined. Changing this forces a new resource to be created.

metadata: pulumi.Output[str] = None

The metadata for the policy definition. This is a json object representing additional metadata that should be stored with the policy definition.

mode: pulumi.Output[str] = None

The policy mode that allows you to specify which resource types will be evaluated. The value can be “All”, “Indexed” or “NotSpecified”. Changing this resource forces a new resource to be created.

name: pulumi.Output[str] = None

The name of the policy definition. Changing this forces a new resource to be created.

parameters: pulumi.Output[str] = None

Parameters for the policy definition. This field is a json object that allows you to parameterize your policy definition.

policy_rule: pulumi.Output[str] = None

The policy rule for the policy definition. This is a json object representing the rule that contains an if and a then block.

policy_type: pulumi.Output[str] = None

The policy type. Possible values are BuiltIn, Custom and NotSpecified. Changing this forces a new resource to be created.

static get(resource_name, id, opts=None, description=None, display_name=None, management_group_id=None, management_group_name=None, metadata=None, mode=None, name=None, parameters=None, policy_rule=None, policy_type=None)

Get an existing Definition resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – The description of the policy definition.

  • display_name (pulumi.Input[str]) – The display name of the policy definition.

  • management_group_name (pulumi.Input[str]) – The name of the Management Group where this policy should be defined. Changing this forces a new resource to be created.

  • metadata (pulumi.Input[str]) – The metadata for the policy definition. This is a json object representing additional metadata that should be stored with the policy definition.

  • mode (pulumi.Input[str]) – The policy mode that allows you to specify which resource types will be evaluated. The value can be “All”, “Indexed” or “NotSpecified”. Changing this resource forces a new resource to be created.

  • name (pulumi.Input[str]) – The name of the policy definition. Changing this forces a new resource to be created.

  • parameters (pulumi.Input[str]) – Parameters for the policy definition. This field is a json object that allows you to parameterize your policy definition.

  • policy_rule (pulumi.Input[str]) – The policy rule for the policy definition. This is a json object representing the rule that contains an if and a then block.

  • policy_type (pulumi.Input[str]) – The policy type. Possible values are BuiltIn, Custom and NotSpecified. Changing this forces a new resource to be created.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.policy.GetPolicyDefintionResult(description=None, display_name=None, id=None, management_group_id=None, management_group_name=None, metadata=None, name=None, parameters=None, policy_rule=None, policy_type=None, type=None)

A collection of values returned by getPolicyDefintion.

description = None

The Description of the Policy.

id = None

The provider-assigned unique ID for this managed resource.

metadata = None

Any Metadata defined in the Policy.

parameters = None

Any Parameters defined in the Policy.

policy_rule = None

The Rule as defined (in JSON) in the Policy.

policy_type = None

The Type of the Policy. Possible values are “BuiltIn”, “Custom” and “NotSpecified”.

type = None

The Type of Policy.

class pulumi_azure.policy.GetPolicySetDefinitionResult(description=None, display_name=None, id=None, management_group_name=None, metadata=None, name=None, parameters=None, policy_definitions=None, policy_type=None)

A collection of values returned by getPolicySetDefinition.

description = None

The Description of the Policy Set Definition.

id = None

The provider-assigned unique ID for this managed resource.

metadata = None

Any Metadata defined in the Policy Set Definition.

parameters = None

Any Parameters defined in the Policy Set Definition.

policy_definitions = None

The policy definitions contained within the policy set definition.

policy_type = None

The Type of the Policy Set Definition.

class pulumi_azure.policy.PolicySetDefinition(resource_name, opts=None, description=None, display_name=None, management_group_id=None, metadata=None, name=None, parameters=None, policy_definitions=None, policy_type=None, __props__=None, __name__=None, __opts__=None)

Manages a policy set definition.

NOTE: Policy set definitions (also known as policy initiatives) do not take effect until they are assigned to a scope using a Policy Set Assignment.

import pulumi
import pulumi_azure as azure

example = azure.policy.PolicySetDefinition("example",
    display_name="Test Policy Set",
    parameters="""    {
        "allowedLocations": {
            "type": "Array",
            "metadata": {
                "description": "The list of allowed locations for resources.",
                "displayName": "Allowed locations",
                "strongType": "location"
            }
        }
    }

""",
    policy_definitions="""    [
        {
            "parameters": {
                "listOfAllowedLocations": {
                    "value": "[parameters('allowedLocations')]"
                }
            },
            "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988"
        }
    ]

""",
    policy_type="Custom")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – The description of the policy set definition.

  • display_name (pulumi.Input[str]) – The display name of the policy set definition.

  • management_group_id (pulumi.Input[str]) – The ID of the Management Group where this policy should be defined. Changing this forces a new resource to be created.

  • metadata (pulumi.Input[str]) – The metadata for the policy set definition. This is a json object representing additional metadata that should be stored with the policy definition.

  • name (pulumi.Input[str]) – The name of the policy set definition. Changing this forces a new resource to be created.

  • parameters (pulumi.Input[str]) – Parameters for the policy set definition. This field is a json object that allows you to parameterize your policy definition.

  • policy_definitions (pulumi.Input[str]) – The policy definitions for the policy set definition. This is a json object representing the bundled policy definitions.

  • policy_type (pulumi.Input[str]) – The policy set type. Possible values are BuiltIn or Custom. Changing this forces a new resource to be created.

description: pulumi.Output[str] = None

The description of the policy set definition.

display_name: pulumi.Output[str] = None

The display name of the policy set definition.

management_group_id: pulumi.Output[str] = None

The ID of the Management Group where this policy should be defined. Changing this forces a new resource to be created.

metadata: pulumi.Output[str] = None

The metadata for the policy set definition. This is a json object representing additional metadata that should be stored with the policy definition.

name: pulumi.Output[str] = None

The name of the policy set definition. Changing this forces a new resource to be created.

parameters: pulumi.Output[str] = None

Parameters for the policy set definition. This field is a json object that allows you to parameterize your policy definition.

policy_definitions: pulumi.Output[str] = None

The policy definitions for the policy set definition. This is a json object representing the bundled policy definitions.

policy_type: pulumi.Output[str] = None

The policy set type. Possible values are BuiltIn or Custom. Changing this forces a new resource to be created.

static get(resource_name, id, opts=None, description=None, display_name=None, management_group_id=None, metadata=None, name=None, parameters=None, policy_definitions=None, policy_type=None)

Get an existing PolicySetDefinition resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – The description of the policy set definition.

  • display_name (pulumi.Input[str]) – The display name of the policy set definition.

  • management_group_id (pulumi.Input[str]) – The ID of the Management Group where this policy should be defined. Changing this forces a new resource to be created.

  • metadata (pulumi.Input[str]) – The metadata for the policy set definition. This is a json object representing additional metadata that should be stored with the policy definition.

  • name (pulumi.Input[str]) – The name of the policy set definition. Changing this forces a new resource to be created.

  • parameters (pulumi.Input[str]) – Parameters for the policy set definition. This field is a json object that allows you to parameterize your policy definition.

  • policy_definitions (pulumi.Input[str]) – The policy definitions for the policy set definition. This is a json object representing the bundled policy definitions.

  • policy_type (pulumi.Input[str]) – The policy set type. Possible values are BuiltIn or Custom. Changing this forces a new resource to be created.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.policy.Remediation(resource_name, opts=None, location_filters=None, name=None, policy_assignment_id=None, policy_definition_reference_id=None, scope=None, __props__=None, __name__=None, __opts__=None)

Manages an Azure Policy Remediation at the specified Scope.

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_definition = azure.policy.Definition("exampleDefinition",
    policy_type="Custom",
    mode="All",
    display_name="my-policy-definition",
    policy_rule="""    {
    "if": {
      "not": {
        "field": "location",
        "in": "[parameters('allowedLocations')]"
      }
    },
    "then": {
      "effect": "audit"
    }
  }
""",
    parameters="""    {
    "allowedLocations": {
      "type": "Array",
      "metadata": {
        "description": "The list of allowed locations for resources.",
        "displayName": "Allowed locations",
        "strongType": "location"
      }
    }
  }
""")
example_assignment = azure.policy.Assignment("exampleAssignment",
    scope=example_resource_group.id,
    policy_definition_id=example_definition.id,
    description="Policy Assignment created via an Acceptance Test",
    display_name="My Example Policy Assignment",
    parameters="""{
  "allowedLocations": {
    "value": [ "West Europe" ]
  }
}
""")
example_remediation = azure.policy.Remediation("exampleRemediation",
    scope=example_assignment.scope,
    policy_assignment_id=example_assignment.id,
    location_filters=["West Europe"])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • location_filters (pulumi.Input[list]) – A list of the resource locations that will be remediated.

  • name (pulumi.Input[str]) – The name of the Policy Remediation. Changing this forces a new resource to be created.

  • policy_assignment_id (pulumi.Input[str]) – The resource ID of the policy assignment that should be remediated.

  • policy_definition_reference_id (pulumi.Input[str]) – The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.

  • scope (pulumi.Input[str]) – The Scope at which the Policy Remediation should be applied. Changing this forces a new resource to be created. A scope must be a Resource ID out of one of the following list:

location_filters: pulumi.Output[list] = None

A list of the resource locations that will be remediated.

name: pulumi.Output[str] = None

The name of the Policy Remediation. Changing this forces a new resource to be created.

policy_assignment_id: pulumi.Output[str] = None

The resource ID of the policy assignment that should be remediated.

policy_definition_reference_id: pulumi.Output[str] = None

The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.

scope: pulumi.Output[str] = None

The Scope at which the Policy Remediation should be applied. Changing this forces a new resource to be created. A scope must be a Resource ID out of one of the following list:

static get(resource_name, id, opts=None, location_filters=None, name=None, policy_assignment_id=None, policy_definition_reference_id=None, scope=None)

Get an existing Remediation resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • location_filters (pulumi.Input[list]) – A list of the resource locations that will be remediated.

  • name (pulumi.Input[str]) – The name of the Policy Remediation. Changing this forces a new resource to be created.

  • policy_assignment_id (pulumi.Input[str]) – The resource ID of the policy assignment that should be remediated.

  • policy_definition_reference_id (pulumi.Input[str]) – The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition.

  • scope (pulumi.Input[str]) – The Scope at which the Policy Remediation should be applied. Changing this forces a new resource to be created. A scope must be a Resource ID out of one of the following list:

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_azure.policy.get_policy_defintion(display_name=None, management_group_id=None, management_group_name=None, name=None, opts=None)

Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default.

import pulumi
import pulumi_azure as azure

example = azure.policy.get_policy_defintion(display_name="Allowed resource types")
pulumi.export("id", example.id)
Parameters
  • display_name (str) – Specifies the display name of the Policy Definition. Conflicts with name.

  • management_group_name (str) – Only retrieve Policy Definitions from this Management Group.

  • name (str) – Specifies the name of the Policy Definition. Conflicts with display_name.

pulumi_azure.policy.get_policy_set_definition(display_name=None, management_group_name=None, name=None, opts=None)

Use this data source to access information about an existing Policy Set Definition.

import pulumi
import pulumi_azure as azure

example = azure.policy.get_policy_set_definition(display_name="Policy Set Definition Example")
pulumi.export("id", example.id)
Parameters
  • display_name (str) – Specifies the display name of the Policy Set Definition. Conflicts with name.

  • management_group_name (str) – Only retrieve Policy Set Definitions from this Management Group.

  • name (str) – Specifies the name of the Policy Set Definition. Conflicts with display_name.