We recommend using Azure Native.
azure.policy.PolicySetDefinition
Explore with Pulumi AI
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.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.policy.PolicySetDefinition("example", {
name: "testPolicySet",
policyType: "Custom",
displayName: "Test Policy Set",
parameters: ` {
"allowedLocations": {
"type": "Array",
"metadata": {
"description": "The list of allowed locations for resources.",
"displayName": "Allowed locations",
"strongType": "location"
}
}
}
`,
policyDefinitionReferences: [{
policyDefinitionId: "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988",
parameterValues: ` {
"listOfAllowedLocations": {"value": "[parameters('allowedLocations')]"}
}
`,
}],
});
import pulumi
import pulumi_azure as azure
example = azure.policy.PolicySetDefinition("example",
name="testPolicySet",
policy_type="Custom",
display_name="Test Policy Set",
parameters=""" {
"allowedLocations": {
"type": "Array",
"metadata": {
"description": "The list of allowed locations for resources.",
"displayName": "Allowed locations",
"strongType": "location"
}
}
}
""",
policy_definition_references=[{
"policy_definition_id": "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988",
"parameter_values": """ {
"listOfAllowedLocations": {"value": "[parameters('allowedLocations')]"}
}
""",
}])
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/policy"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := policy.NewPolicySetDefinition(ctx, "example", &policy.PolicySetDefinitionArgs{
Name: pulumi.String("testPolicySet"),
PolicyType: pulumi.String("Custom"),
DisplayName: pulumi.String("Test Policy Set"),
Parameters: pulumi.String(` {
"allowedLocations": {
"type": "Array",
"metadata": {
"description": "The list of allowed locations for resources.",
"displayName": "Allowed locations",
"strongType": "location"
}
}
}
`),
PolicyDefinitionReferences: policy.PolicySetDefinitionPolicyDefinitionReferenceArray{
&policy.PolicySetDefinitionPolicyDefinitionReferenceArgs{
PolicyDefinitionId: pulumi.String("/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988"),
ParameterValues: pulumi.String(" {\n \"listOfAllowedLocations\": {\"value\": \"[parameters('allowedLocations')]\"}\n }\n"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Policy.PolicySetDefinition("example", new()
{
Name = "testPolicySet",
PolicyType = "Custom",
DisplayName = "Test Policy Set",
Parameters = @" {
""allowedLocations"": {
""type"": ""Array"",
""metadata"": {
""description"": ""The list of allowed locations for resources."",
""displayName"": ""Allowed locations"",
""strongType"": ""location""
}
}
}
",
PolicyDefinitionReferences = new[]
{
new Azure.Policy.Inputs.PolicySetDefinitionPolicyDefinitionReferenceArgs
{
PolicyDefinitionId = "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988",
ParameterValues = @" {
""listOfAllowedLocations"": {""value"": ""[parameters('allowedLocations')]""}
}
",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.policy.PolicySetDefinition;
import com.pulumi.azure.policy.PolicySetDefinitionArgs;
import com.pulumi.azure.policy.inputs.PolicySetDefinitionPolicyDefinitionReferenceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new PolicySetDefinition("example", PolicySetDefinitionArgs.builder()
.name("testPolicySet")
.policyType("Custom")
.displayName("Test Policy Set")
.parameters("""
{
"allowedLocations": {
"type": "Array",
"metadata": {
"description": "The list of allowed locations for resources.",
"displayName": "Allowed locations",
"strongType": "location"
}
}
}
""")
.policyDefinitionReferences(PolicySetDefinitionPolicyDefinitionReferenceArgs.builder()
.policyDefinitionId("/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988")
.parameterValues("""
{
"listOfAllowedLocations": {"value": "[parameters('allowedLocations')]"}
}
""")
.build())
.build());
}
}
resources:
example:
type: azure:policy:PolicySetDefinition
properties:
name: testPolicySet
policyType: Custom
displayName: Test Policy Set
parameters: |2
{
"allowedLocations": {
"type": "Array",
"metadata": {
"description": "The list of allowed locations for resources.",
"displayName": "Allowed locations",
"strongType": "location"
}
}
}
policyDefinitionReferences:
- policyDefinitionId: /providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988
parameterValues: |2
{
"listOfAllowedLocations": {"value": "[parameters('allowedLocations')]"}
}
Create PolicySetDefinition Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PolicySetDefinition(name: string, args: PolicySetDefinitionArgs, opts?: CustomResourceOptions);
@overload
def PolicySetDefinition(resource_name: str,
args: PolicySetDefinitionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PolicySetDefinition(resource_name: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
policy_definition_references: Optional[Sequence[PolicySetDefinitionPolicyDefinitionReferenceArgs]] = None,
policy_type: Optional[str] = None,
description: Optional[str] = None,
management_group_id: Optional[str] = None,
metadata: Optional[str] = None,
name: Optional[str] = None,
parameters: Optional[str] = None,
policy_definition_groups: Optional[Sequence[PolicySetDefinitionPolicyDefinitionGroupArgs]] = None)
func NewPolicySetDefinition(ctx *Context, name string, args PolicySetDefinitionArgs, opts ...ResourceOption) (*PolicySetDefinition, error)
public PolicySetDefinition(string name, PolicySetDefinitionArgs args, CustomResourceOptions? opts = null)
public PolicySetDefinition(String name, PolicySetDefinitionArgs args)
public PolicySetDefinition(String name, PolicySetDefinitionArgs args, CustomResourceOptions options)
type: azure:policy:PolicySetDefinition
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args PolicySetDefinitionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PolicySetDefinitionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PolicySetDefinitionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicySetDefinitionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicySetDefinitionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var policySetDefinitionResource = new Azure.Policy.PolicySetDefinition("policySetDefinitionResource", new()
{
DisplayName = "string",
PolicyDefinitionReferences = new[]
{
new Azure.Policy.Inputs.PolicySetDefinitionPolicyDefinitionReferenceArgs
{
PolicyDefinitionId = "string",
ParameterValues = "string",
PolicyGroupNames = new[]
{
"string",
},
ReferenceId = "string",
},
},
PolicyType = "string",
Description = "string",
ManagementGroupId = "string",
Metadata = "string",
Name = "string",
Parameters = "string",
PolicyDefinitionGroups = new[]
{
new Azure.Policy.Inputs.PolicySetDefinitionPolicyDefinitionGroupArgs
{
Name = "string",
AdditionalMetadataResourceId = "string",
Category = "string",
Description = "string",
DisplayName = "string",
},
},
});
example, err := policy.NewPolicySetDefinition(ctx, "policySetDefinitionResource", &policy.PolicySetDefinitionArgs{
DisplayName: pulumi.String("string"),
PolicyDefinitionReferences: policy.PolicySetDefinitionPolicyDefinitionReferenceArray{
&policy.PolicySetDefinitionPolicyDefinitionReferenceArgs{
PolicyDefinitionId: pulumi.String("string"),
ParameterValues: pulumi.String("string"),
PolicyGroupNames: pulumi.StringArray{
pulumi.String("string"),
},
ReferenceId: pulumi.String("string"),
},
},
PolicyType: pulumi.String("string"),
Description: pulumi.String("string"),
ManagementGroupId: pulumi.String("string"),
Metadata: pulumi.String("string"),
Name: pulumi.String("string"),
Parameters: pulumi.String("string"),
PolicyDefinitionGroups: policy.PolicySetDefinitionPolicyDefinitionGroupArray{
&policy.PolicySetDefinitionPolicyDefinitionGroupArgs{
Name: pulumi.String("string"),
AdditionalMetadataResourceId: pulumi.String("string"),
Category: pulumi.String("string"),
Description: pulumi.String("string"),
DisplayName: pulumi.String("string"),
},
},
})
var policySetDefinitionResource = new PolicySetDefinition("policySetDefinitionResource", PolicySetDefinitionArgs.builder()
.displayName("string")
.policyDefinitionReferences(PolicySetDefinitionPolicyDefinitionReferenceArgs.builder()
.policyDefinitionId("string")
.parameterValues("string")
.policyGroupNames("string")
.referenceId("string")
.build())
.policyType("string")
.description("string")
.managementGroupId("string")
.metadata("string")
.name("string")
.parameters("string")
.policyDefinitionGroups(PolicySetDefinitionPolicyDefinitionGroupArgs.builder()
.name("string")
.additionalMetadataResourceId("string")
.category("string")
.description("string")
.displayName("string")
.build())
.build());
policy_set_definition_resource = azure.policy.PolicySetDefinition("policySetDefinitionResource",
display_name="string",
policy_definition_references=[{
"policy_definition_id": "string",
"parameter_values": "string",
"policy_group_names": ["string"],
"reference_id": "string",
}],
policy_type="string",
description="string",
management_group_id="string",
metadata="string",
name="string",
parameters="string",
policy_definition_groups=[{
"name": "string",
"additional_metadata_resource_id": "string",
"category": "string",
"description": "string",
"display_name": "string",
}])
const policySetDefinitionResource = new azure.policy.PolicySetDefinition("policySetDefinitionResource", {
displayName: "string",
policyDefinitionReferences: [{
policyDefinitionId: "string",
parameterValues: "string",
policyGroupNames: ["string"],
referenceId: "string",
}],
policyType: "string",
description: "string",
managementGroupId: "string",
metadata: "string",
name: "string",
parameters: "string",
policyDefinitionGroups: [{
name: "string",
additionalMetadataResourceId: "string",
category: "string",
description: "string",
displayName: "string",
}],
});
type: azure:policy:PolicySetDefinition
properties:
description: string
displayName: string
managementGroupId: string
metadata: string
name: string
parameters: string
policyDefinitionGroups:
- additionalMetadataResourceId: string
category: string
description: string
displayName: string
name: string
policyDefinitionReferences:
- parameterValues: string
policyDefinitionId: string
policyGroupNames:
- string
referenceId: string
policyType: string
PolicySetDefinition Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The PolicySetDefinition resource accepts the following input properties:
- Display
Name string - The display name of the policy set definition.
- Policy
Definition List<PolicyReferences Set Definition Policy Definition Reference> - One or more
policy_definition_reference
blocks as defined below. - Policy
Type string - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created. - Description string
- The description of the policy set definition.
- Management
Group stringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- Metadata string
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- Name string
- The name of the policy set definition. Changing this forces a new resource to be created.
- Parameters string
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- Policy
Definition List<PolicyGroups Set Definition Policy Definition Group> - One or more
policy_definition_group
blocks as defined below.
- Display
Name string - The display name of the policy set definition.
- Policy
Definition []PolicyReferences Set Definition Policy Definition Reference Args - One or more
policy_definition_reference
blocks as defined below. - Policy
Type string - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created. - Description string
- The description of the policy set definition.
- Management
Group stringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- Metadata string
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- Name string
- The name of the policy set definition. Changing this forces a new resource to be created.
- Parameters string
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- Policy
Definition []PolicyGroups Set Definition Policy Definition Group Args - One or more
policy_definition_group
blocks as defined below.
- display
Name String - The display name of the policy set definition.
- policy
Definition List<PolicyReferences Set Definition Policy Definition Reference> - One or more
policy_definition_reference
blocks as defined below. - policy
Type String - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created. - description String
- The description of the policy set definition.
- management
Group StringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- metadata String
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- name String
- The name of the policy set definition. Changing this forces a new resource to be created.
- parameters String
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- policy
Definition List<PolicyGroups Set Definition Policy Definition Group> - One or more
policy_definition_group
blocks as defined below.
- display
Name string - The display name of the policy set definition.
- policy
Definition PolicyReferences Set Definition Policy Definition Reference[] - One or more
policy_definition_reference
blocks as defined below. - policy
Type string - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created. - description string
- The description of the policy set definition.
- management
Group stringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- metadata string
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- name string
- The name of the policy set definition. Changing this forces a new resource to be created.
- parameters string
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- policy
Definition PolicyGroups Set Definition Policy Definition Group[] - One or more
policy_definition_group
blocks as defined below.
- display_
name str - The display name of the policy set definition.
- policy_
definition_ Sequence[Policyreferences Set Definition Policy Definition Reference Args] - One or more
policy_definition_reference
blocks as defined below. - policy_
type str - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created. - description str
- The description of the policy set definition.
- management_
group_ strid - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- metadata 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 str
- The name of the policy set definition. Changing this forces a new resource to be created.
- parameters str
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- policy_
definition_ Sequence[Policygroups Set Definition Policy Definition Group Args] - One or more
policy_definition_group
blocks as defined below.
- display
Name String - The display name of the policy set definition.
- policy
Definition List<Property Map>References - One or more
policy_definition_reference
blocks as defined below. - policy
Type String - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created. - description String
- The description of the policy set definition.
- management
Group StringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- metadata String
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- name String
- The name of the policy set definition. Changing this forces a new resource to be created.
- parameters String
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- policy
Definition List<Property Map>Groups - One or more
policy_definition_group
blocks as defined below.
Outputs
All input properties are implicitly available as output properties. Additionally, the PolicySetDefinition resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing PolicySetDefinition Resource
Get an existing PolicySetDefinition resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PolicySetDefinitionState, opts?: CustomResourceOptions): PolicySetDefinition
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
management_group_id: Optional[str] = None,
metadata: Optional[str] = None,
name: Optional[str] = None,
parameters: Optional[str] = None,
policy_definition_groups: Optional[Sequence[PolicySetDefinitionPolicyDefinitionGroupArgs]] = None,
policy_definition_references: Optional[Sequence[PolicySetDefinitionPolicyDefinitionReferenceArgs]] = None,
policy_type: Optional[str] = None) -> PolicySetDefinition
func GetPolicySetDefinition(ctx *Context, name string, id IDInput, state *PolicySetDefinitionState, opts ...ResourceOption) (*PolicySetDefinition, error)
public static PolicySetDefinition Get(string name, Input<string> id, PolicySetDefinitionState? state, CustomResourceOptions? opts = null)
public static PolicySetDefinition get(String name, Output<String> id, PolicySetDefinitionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Description string
- The description of the policy set definition.
- Display
Name string - The display name of the policy set definition.
- Management
Group stringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- Metadata string
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- Name string
- The name of the policy set definition. Changing this forces a new resource to be created.
- Parameters string
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- Policy
Definition List<PolicyGroups Set Definition Policy Definition Group> - One or more
policy_definition_group
blocks as defined below. - Policy
Definition List<PolicyReferences Set Definition Policy Definition Reference> - One or more
policy_definition_reference
blocks as defined below. - Policy
Type string - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created.
- Description string
- The description of the policy set definition.
- Display
Name string - The display name of the policy set definition.
- Management
Group stringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- Metadata string
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- Name string
- The name of the policy set definition. Changing this forces a new resource to be created.
- Parameters string
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- Policy
Definition []PolicyGroups Set Definition Policy Definition Group Args - One or more
policy_definition_group
blocks as defined below. - Policy
Definition []PolicyReferences Set Definition Policy Definition Reference Args - One or more
policy_definition_reference
blocks as defined below. - Policy
Type string - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created.
- description String
- The description of the policy set definition.
- display
Name String - The display name of the policy set definition.
- management
Group StringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- metadata String
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- name String
- The name of the policy set definition. Changing this forces a new resource to be created.
- parameters String
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- policy
Definition List<PolicyGroups Set Definition Policy Definition Group> - One or more
policy_definition_group
blocks as defined below. - policy
Definition List<PolicyReferences Set Definition Policy Definition Reference> - One or more
policy_definition_reference
blocks as defined below. - policy
Type String - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created.
- description string
- The description of the policy set definition.
- display
Name string - The display name of the policy set definition.
- management
Group stringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- metadata string
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- name string
- The name of the policy set definition. Changing this forces a new resource to be created.
- parameters string
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- policy
Definition PolicyGroups Set Definition Policy Definition Group[] - One or more
policy_definition_group
blocks as defined below. - policy
Definition PolicyReferences Set Definition Policy Definition Reference[] - One or more
policy_definition_reference
blocks as defined below. - policy
Type string - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created.
- description str
- The description of the policy set definition.
- display_
name str - The display name of the policy set definition.
- management_
group_ strid - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- metadata 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 str
- The name of the policy set definition. Changing this forces a new resource to be created.
- parameters str
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- policy_
definition_ Sequence[Policygroups Set Definition Policy Definition Group Args] - One or more
policy_definition_group
blocks as defined below. - policy_
definition_ Sequence[Policyreferences Set Definition Policy Definition Reference Args] - One or more
policy_definition_reference
blocks as defined below. - policy_
type str - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created.
- description String
- The description of the policy set definition.
- display
Name String - The display name of the policy set definition.
- management
Group StringId - The id of the Management Group where this policy set definition should be defined. Changing this forces a new resource to be created.
- metadata String
- The metadata for the policy set definition. This is a JSON object representing additional metadata that should be stored with the policy definition.
- name String
- The name of the policy set definition. Changing this forces a new resource to be created.
- parameters String
- Parameters for the policy set definition. This field is a JSON object that allows you to parameterize your policy definition.
- policy
Definition List<Property Map>Groups - One or more
policy_definition_group
blocks as defined below. - policy
Definition List<Property Map>References - One or more
policy_definition_reference
blocks as defined below. - policy
Type String - The policy set type. Possible values are
BuiltIn
,Custom
,NotSpecified
andStatic
. Changing this forces a new resource to be created.
Supporting Types
PolicySetDefinitionPolicyDefinitionGroup, PolicySetDefinitionPolicyDefinitionGroupArgs
- Name string
- The name of this policy definition group.
- Additional
Metadata stringResource Id - The ID of a resource that contains additional metadata about this policy definition group.
- Category string
- The category of this policy definition group.
- Description string
- The description of this policy definition group.
- Display
Name string - The display name of this policy definition group.
- Name string
- The name of this policy definition group.
- Additional
Metadata stringResource Id - The ID of a resource that contains additional metadata about this policy definition group.
- Category string
- The category of this policy definition group.
- Description string
- The description of this policy definition group.
- Display
Name string - The display name of this policy definition group.
- name String
- The name of this policy definition group.
- additional
Metadata StringResource Id - The ID of a resource that contains additional metadata about this policy definition group.
- category String
- The category of this policy definition group.
- description String
- The description of this policy definition group.
- display
Name String - The display name of this policy definition group.
- name string
- The name of this policy definition group.
- additional
Metadata stringResource Id - The ID of a resource that contains additional metadata about this policy definition group.
- category string
- The category of this policy definition group.
- description string
- The description of this policy definition group.
- display
Name string - The display name of this policy definition group.
- name str
- The name of this policy definition group.
- additional_
metadata_ strresource_ id - The ID of a resource that contains additional metadata about this policy definition group.
- category str
- The category of this policy definition group.
- description str
- The description of this policy definition group.
- display_
name str - The display name of this policy definition group.
- name String
- The name of this policy definition group.
- additional
Metadata StringResource Id - The ID of a resource that contains additional metadata about this policy definition group.
- category String
- The category of this policy definition group.
- description String
- The description of this policy definition group.
- display
Name String - The display name of this policy definition group.
PolicySetDefinitionPolicyDefinitionReference, PolicySetDefinitionPolicyDefinitionReferenceArgs
- Policy
Definition stringId - The ID of the policy definition that will be included in this policy set definition.
- Parameter
Values string - Parameter values for the referenced policy rule. This field is a JSON string that allows you to assign parameters to this policy rule.
- Policy
Group List<string>Names - A list of names of the policy definition groups that this policy definition reference belongs to.
- Reference
Id string - A unique ID within this policy set definition for this policy definition reference.
- Policy
Definition stringId - The ID of the policy definition that will be included in this policy set definition.
- Parameter
Values string - Parameter values for the referenced policy rule. This field is a JSON string that allows you to assign parameters to this policy rule.
- Policy
Group []stringNames - A list of names of the policy definition groups that this policy definition reference belongs to.
- Reference
Id string - A unique ID within this policy set definition for this policy definition reference.
- policy
Definition StringId - The ID of the policy definition that will be included in this policy set definition.
- parameter
Values String - Parameter values for the referenced policy rule. This field is a JSON string that allows you to assign parameters to this policy rule.
- policy
Group List<String>Names - A list of names of the policy definition groups that this policy definition reference belongs to.
- reference
Id String - A unique ID within this policy set definition for this policy definition reference.
- policy
Definition stringId - The ID of the policy definition that will be included in this policy set definition.
- parameter
Values string - Parameter values for the referenced policy rule. This field is a JSON string that allows you to assign parameters to this policy rule.
- policy
Group string[]Names - A list of names of the policy definition groups that this policy definition reference belongs to.
- reference
Id string - A unique ID within this policy set definition for this policy definition reference.
- policy_
definition_ strid - The ID of the policy definition that will be included in this policy set definition.
- parameter_
values str - Parameter values for the referenced policy rule. This field is a JSON string that allows you to assign parameters to this policy rule.
- policy_
group_ Sequence[str]names - A list of names of the policy definition groups that this policy definition reference belongs to.
- reference_
id str - A unique ID within this policy set definition for this policy definition reference.
- policy
Definition StringId - The ID of the policy definition that will be included in this policy set definition.
- parameter
Values String - Parameter values for the referenced policy rule. This field is a JSON string that allows you to assign parameters to this policy rule.
- policy
Group List<String>Names - A list of names of the policy definition groups that this policy definition reference belongs to.
- reference
Id String - A unique ID within this policy set definition for this policy definition reference.
Import
Policy Set Definitions can be imported using the resource id
, e.g.
$ pulumi import azure:policy/policySetDefinition:PolicySetDefinition example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/policySetDefinitions/testPolicySet
or
$ pulumi import azure:policy/policySetDefinition:PolicySetDefinition example /providers/Microsoft.Management/managementGroups/my-mgmt-group-id/providers/Microsoft.Authorization/policySetDefinitions/testPolicySet
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.