Class PolicySetDefinition
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
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = new Azure.Policy.PolicySetDefinition("example", new Azure.Policy.PolicySetDefinitionArgs
{
DisplayName = "Test Policy Set",
Parameters = @" {
""allowedLocations"": {
""type"": ""Array"",
""metadata"": {
""description"": ""The list of allowed locations for resources."",
""displayName"": ""Allowed locations"",
""strongType"": ""location""
}
}
}
",
PolicyDefinitions = @" [
{
""parameters"": {
""listOfAllowedLocations"": {
""value"": ""[parameters('allowedLocations')]""
}
},
""policyDefinitionId"": ""/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988""
}
]
",
PolicyType = "Custom",
});
}
}
Inherited Members
Namespace: Pulumi.Azure.Policy
Assembly: Pulumi.Azure.dll
Syntax
public class PolicySetDefinition : CustomResource
Constructors
View SourcePolicySetDefinition(String, PolicySetDefinitionArgs, CustomResourceOptions)
Create a PolicySetDefinition resource with the given unique name, arguments, and options.
Declaration
public PolicySetDefinition(string name, PolicySetDefinitionArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| PolicySetDefinitionArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDescription
The description of the policy set definition.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DisplayName
The display name of the policy set definition.
Declaration
public Output<string> DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ManagementGroupId
The ID of the Management Group where this policy should be defined. Changing this forces a new resource to be created.
Declaration
public Output<string> ManagementGroupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Metadata
The metadata for the policy set definition. This is a json object representing additional metadata that should be stored with the policy definition.
Declaration
public Output<string> Metadata { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name of the policy set definition. Changing this forces a new resource to be created.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Parameters
Parameters for the policy set definition. This field is a json object that allows you to parameterize your policy definition.
Declaration
public Output<string> Parameters { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PolicyDefinitions
The policy definitions for the policy set definition. This is a json object representing the bundled policy definitions.
Declaration
public Output<string> PolicyDefinitions { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PolicyType
The policy set type. Possible values are BuiltIn or Custom. Changing this forces a new resource to be created.
Declaration
public Output<string> PolicyType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, PolicySetDefinitionState, CustomResourceOptions)
Get an existing PolicySetDefinition resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static PolicySetDefinition Get(string name, Input<string> id, PolicySetDefinitionState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| PolicySetDefinitionState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| PolicySetDefinition |