PolicySetDefinition

class PolicySetDefinition : KotlinCustomResource

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

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()
.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()
.parameterValues("""
{
"listOfAllowedLocations": {"value": "[parameters('allowedLocations')]"}
}
""")
.policyDefinitionId("/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988")
.build())
.policyType("Custom")
.build());
}
}

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

Properties

Link copied to clipboard
val description: Output<String>?

The description of the policy set definition.

Link copied to clipboard
val displayName: Output<String>

The display name of the policy set definition.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

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

Link copied to clipboard
val metadata: Output<String>

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

Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard
val parameters: Output<String>?

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

Link copied to clipboard

One or more policy_definition_group blocks as defined below.

Link copied to clipboard

One or more policy_definition_reference blocks as defined below.

Link copied to clipboard
val policyType: Output<String>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>