We recommend using Azure Native.
azure.policy.getPolicySetDefinition
Explore with Pulumi AI
Use this data source to access information about an existing Policy Set Definition.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.policy.getPolicySetDefinition({
    displayName: "Policy Set Definition Example",
});
export const id = example.then(example => example.id);
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)
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 {
		example, err := policy.LookupPolicySetDefinition(ctx, &policy.LookupPolicySetDefinitionArgs{
			DisplayName: pulumi.StringRef("Policy Set Definition Example"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.Policy.GetPolicySetDefinition.Invoke(new()
    {
        DisplayName = "Policy Set Definition Example",
    });
    return new Dictionary<string, object?>
    {
        ["id"] = example.Apply(getPolicySetDefinitionResult => getPolicySetDefinitionResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.policy.PolicyFunctions;
import com.pulumi.azure.policy.inputs.GetPolicySetDefinitionArgs;
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) {
        final var example = PolicyFunctions.getPolicySetDefinition(GetPolicySetDefinitionArgs.builder()
            .displayName("Policy Set Definition Example")
            .build());
        ctx.export("id", example.applyValue(getPolicySetDefinitionResult -> getPolicySetDefinitionResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:policy:getPolicySetDefinition
      arguments:
        displayName: Policy Set Definition Example
outputs:
  id: ${example.id}
Using getPolicySetDefinition
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getPolicySetDefinition(args: GetPolicySetDefinitionArgs, opts?: InvokeOptions): Promise<GetPolicySetDefinitionResult>
function getPolicySetDefinitionOutput(args: GetPolicySetDefinitionOutputArgs, opts?: InvokeOptions): Output<GetPolicySetDefinitionResult>def get_policy_set_definition(display_name: Optional[str] = None,
                              management_group_name: Optional[str] = None,
                              name: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetPolicySetDefinitionResult
def get_policy_set_definition_output(display_name: Optional[pulumi.Input[str]] = None,
                              management_group_name: Optional[pulumi.Input[str]] = None,
                              name: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetPolicySetDefinitionResult]func LookupPolicySetDefinition(ctx *Context, args *LookupPolicySetDefinitionArgs, opts ...InvokeOption) (*LookupPolicySetDefinitionResult, error)
func LookupPolicySetDefinitionOutput(ctx *Context, args *LookupPolicySetDefinitionOutputArgs, opts ...InvokeOption) LookupPolicySetDefinitionResultOutput> Note: This function is named LookupPolicySetDefinition in the Go SDK.
public static class GetPolicySetDefinition 
{
    public static Task<GetPolicySetDefinitionResult> InvokeAsync(GetPolicySetDefinitionArgs args, InvokeOptions? opts = null)
    public static Output<GetPolicySetDefinitionResult> Invoke(GetPolicySetDefinitionInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPolicySetDefinitionResult> getPolicySetDefinition(GetPolicySetDefinitionArgs args, InvokeOptions options)
public static Output<GetPolicySetDefinitionResult> getPolicySetDefinition(GetPolicySetDefinitionArgs args, InvokeOptions options)
fn::invoke:
  function: azure:policy/getPolicySetDefinition:getPolicySetDefinition
  arguments:
    # arguments dictionaryThe following arguments are supported:
- DisplayName string
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- ManagementGroup stringName 
- Only retrieve Policy Set Definitions from this Management Group.
- Name string
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- DisplayName string
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- ManagementGroup stringName 
- Only retrieve Policy Set Definitions from this Management Group.
- Name string
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- displayName String
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- managementGroup StringName 
- Only retrieve Policy Set Definitions from this Management Group.
- name String
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- displayName string
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- managementGroup stringName 
- Only retrieve Policy Set Definitions from this Management Group.
- name string
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- display_name str
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- management_group_ strname 
- Only retrieve Policy Set Definitions from this Management Group.
- name str
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- displayName String
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- managementGroup StringName 
- Only retrieve Policy Set Definitions from this Management Group.
- name String
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
getPolicySetDefinition Result
The following output properties are available:
- Description string
- The description of this policy definition group.
- DisplayName string
- The display name of this policy definition group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata string
- Any Metadata defined in the Policy Set Definition.
- Name string
- The name of this policy definition group.
- Parameters string
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- PolicyDefinition List<GetGroups Policy Set Definition Policy Definition Group> 
- One or more policy_definition_groupblocks as defined below.
- PolicyDefinition List<GetReferences Policy Set Definition Policy Definition Reference> 
- One or more policy_definition_referenceblocks as defined below.
- PolicyDefinitions string
- The policy definitions contained within the policy set definition.
- PolicyType string
- The Type of the Policy Set Definition.
- ManagementGroup stringName 
- Description string
- The description of this policy definition group.
- DisplayName string
- The display name of this policy definition group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata string
- Any Metadata defined in the Policy Set Definition.
- Name string
- The name of this policy definition group.
- Parameters string
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- PolicyDefinition []GetGroups Policy Set Definition Policy Definition Group 
- One or more policy_definition_groupblocks as defined below.
- PolicyDefinition []GetReferences Policy Set Definition Policy Definition Reference 
- One or more policy_definition_referenceblocks as defined below.
- PolicyDefinitions string
- The policy definitions contained within the policy set definition.
- PolicyType string
- The Type of the Policy Set Definition.
- ManagementGroup stringName 
- description String
- The description of this policy definition group.
- displayName String
- The display name of this policy definition group.
- id String
- The provider-assigned unique ID for this managed resource.
- metadata String
- Any Metadata defined in the Policy Set Definition.
- name String
- The name of this policy definition group.
- parameters String
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- policyDefinition List<GetGroups Policy Set Definition Policy Definition Group> 
- One or more policy_definition_groupblocks as defined below.
- policyDefinition List<GetReferences Policy Set Definition Policy Definition Reference> 
- One or more policy_definition_referenceblocks as defined below.
- policyDefinitions String
- The policy definitions contained within the policy set definition.
- policyType String
- The Type of the Policy Set Definition.
- managementGroup StringName 
- description string
- The description of this policy definition group.
- displayName string
- The display name of this policy definition group.
- id string
- The provider-assigned unique ID for this managed resource.
- metadata string
- Any Metadata defined in the Policy Set Definition.
- name string
- The name of this policy definition group.
- parameters string
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- policyDefinition GetGroups Policy Set Definition Policy Definition Group[] 
- One or more policy_definition_groupblocks as defined below.
- policyDefinition GetReferences Policy Set Definition Policy Definition Reference[] 
- One or more policy_definition_referenceblocks as defined below.
- policyDefinitions string
- The policy definitions contained within the policy set definition.
- policyType string
- The Type of the Policy Set Definition.
- managementGroup stringName 
- description str
- The description of this policy definition group.
- display_name str
- The display name of this policy definition group.
- id str
- The provider-assigned unique ID for this managed resource.
- metadata str
- Any Metadata defined in the Policy Set Definition.
- name str
- The name of this policy definition group.
- parameters str
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- policy_definition_ Sequence[Getgroups Policy Set Definition Policy Definition Group] 
- One or more policy_definition_groupblocks as defined below.
- policy_definition_ Sequence[Getreferences Policy Set Definition Policy Definition Reference] 
- One or more policy_definition_referenceblocks as defined below.
- policy_definitions str
- The policy definitions contained within the policy set definition.
- policy_type str
- The Type of the Policy Set Definition.
- management_group_ strname 
- description String
- The description of this policy definition group.
- displayName String
- The display name of this policy definition group.
- id String
- The provider-assigned unique ID for this managed resource.
- metadata String
- Any Metadata defined in the Policy Set Definition.
- name String
- The name of this policy definition group.
- parameters String
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- policyDefinition List<Property Map>Groups 
- One or more policy_definition_groupblocks as defined below.
- policyDefinition List<Property Map>References 
- One or more policy_definition_referenceblocks as defined below.
- policyDefinitions String
- The policy definitions contained within the policy set definition.
- policyType String
- The Type of the Policy Set Definition.
- managementGroup StringName 
Supporting Types
GetPolicySetDefinitionPolicyDefinitionGroup      
- AdditionalMetadata 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.
- DisplayName string
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- Name string
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- AdditionalMetadata 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.
- DisplayName string
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- Name string
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- additionalMetadata 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.
- displayName String
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- name String
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- additionalMetadata 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.
- displayName string
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- name string
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- 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
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- name str
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
- additionalMetadata 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.
- displayName String
- Specifies the display name of the Policy Set Definition. Conflicts with - name.- NOTE As - display_nameis not unique errors may occur when there are multiple policy set definitions with same display name.
- name String
- Specifies the name of the Policy Set Definition. Conflicts with display_name.
GetPolicySetDefinitionPolicyDefinitionReference      
- ParameterValues string
- The parameter values for the referenced policy rule. This field is a JSON object.
- Parameters Dictionary<string, string>
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- PolicyDefinition stringId 
- The ID of the policy definition or policy set definition that is included in this policy set definition.
- PolicyGroup List<string>Names 
- The list of names of the policy definition groups that this policy definition reference belongs to.
- ReferenceId string
- The unique ID within this policy set definition for this policy definition reference.
- ParameterValues string
- The parameter values for the referenced policy rule. This field is a JSON object.
- Parameters map[string]string
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- PolicyDefinition stringId 
- The ID of the policy definition or policy set definition that is included in this policy set definition.
- PolicyGroup []stringNames 
- The list of names of the policy definition groups that this policy definition reference belongs to.
- ReferenceId string
- The unique ID within this policy set definition for this policy definition reference.
- parameterValues String
- The parameter values for the referenced policy rule. This field is a JSON object.
- parameters Map<String,String>
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- policyDefinition StringId 
- The ID of the policy definition or policy set definition that is included in this policy set definition.
- policyGroup List<String>Names 
- The list of names of the policy definition groups that this policy definition reference belongs to.
- referenceId String
- The unique ID within this policy set definition for this policy definition reference.
- parameterValues string
- The parameter values for the referenced policy rule. This field is a JSON object.
- parameters {[key: string]: string}
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- policyDefinition stringId 
- The ID of the policy definition or policy set definition that is included in this policy set definition.
- policyGroup string[]Names 
- The list of names of the policy definition groups that this policy definition reference belongs to.
- referenceId string
- The unique ID within this policy set definition for this policy definition reference.
- parameter_values str
- The parameter values for the referenced policy rule. This field is a JSON object.
- parameters Mapping[str, str]
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- policy_definition_ strid 
- The ID of the policy definition or policy set definition that is included in this policy set definition.
- policy_group_ Sequence[str]names 
- The list of names of the policy definition groups that this policy definition reference belongs to.
- reference_id str
- The unique ID within this policy set definition for this policy definition reference.
- parameterValues String
- The parameter values for the referenced policy rule. This field is a JSON object.
- parameters Map<String>
- The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
- policyDefinition StringId 
- The ID of the policy definition or policy set definition that is included in this policy set definition.
- policyGroup List<String>Names 
- The list of names of the policy definition groups that this policy definition reference belongs to.
- referenceId String
- The unique ID within this policy set definition for this policy definition reference.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.