1. Packages
  2. Azure Classic
  3. API Docs
  4. policy
  5. getPolicySetDefinition

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

azure.policy.getPolicySetDefinition

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:policy/getPolicySetDefinition:getPolicySetDefinition
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DisplayName string

    Specifies the display name of the Policy Set Definition. Conflicts with name.

    NOTE As display_name is not unique errors may occur when there are multiple policy set definitions with same display name.

    ManagementGroupName string
    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_name is not unique errors may occur when there are multiple policy set definitions with same display name.

    ManagementGroupName string
    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_name is not unique errors may occur when there are multiple policy set definitions with same display name.

    managementGroupName String
    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_name is not unique errors may occur when there are multiple policy set definitions with same display name.

    managementGroupName string
    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_name is not unique errors may occur when there are multiple policy set definitions with same display 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.
    displayName String

    Specifies the display name of the Policy Set Definition. Conflicts with name.

    NOTE As display_name is not unique errors may occur when there are multiple policy set definitions with same display name.

    managementGroupName String
    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.
    PolicyDefinitionGroups List<GetPolicySetDefinitionPolicyDefinitionGroup>
    One or more policy_definition_group blocks as defined below.
    PolicyDefinitionReferences List<GetPolicySetDefinitionPolicyDefinitionReference>
    One or more policy_definition_reference blocks as defined below.
    PolicyDefinitions string
    The policy definitions contained within the policy set definition.
    PolicyType string
    The Type of the Policy Set Definition.
    ManagementGroupName string
    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.
    PolicyDefinitionGroups []GetPolicySetDefinitionPolicyDefinitionGroup
    One or more policy_definition_group blocks as defined below.
    PolicyDefinitionReferences []GetPolicySetDefinitionPolicyDefinitionReference
    One or more policy_definition_reference blocks as defined below.
    PolicyDefinitions string
    The policy definitions contained within the policy set definition.
    PolicyType string
    The Type of the Policy Set Definition.
    ManagementGroupName string
    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.
    policyDefinitionGroups List<GetPolicySetDefinitionPolicyDefinitionGroup>
    One or more policy_definition_group blocks as defined below.
    policyDefinitionReferences List<GetPolicySetDefinitionPolicyDefinitionReference>
    One or more policy_definition_reference blocks as defined below.
    policyDefinitions String
    The policy definitions contained within the policy set definition.
    policyType String
    The Type of the Policy Set Definition.
    managementGroupName String
    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.
    policyDefinitionGroups GetPolicySetDefinitionPolicyDefinitionGroup[]
    One or more policy_definition_group blocks as defined below.
    policyDefinitionReferences GetPolicySetDefinitionPolicyDefinitionReference[]
    One or more policy_definition_reference blocks as defined below.
    policyDefinitions string
    The policy definitions contained within the policy set definition.
    policyType string
    The Type of the Policy Set Definition.
    managementGroupName string
    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_groups Sequence[GetPolicySetDefinitionPolicyDefinitionGroup]
    One or more policy_definition_group blocks as defined below.
    policy_definition_references Sequence[GetPolicySetDefinitionPolicyDefinitionReference]
    One or more policy_definition_reference blocks 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_name str
    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.
    policyDefinitionGroups List<Property Map>
    One or more policy_definition_group blocks as defined below.
    policyDefinitionReferences List<Property Map>
    One or more policy_definition_reference blocks as defined below.
    policyDefinitions String
    The policy definitions contained within the policy set definition.
    policyType String
    The Type of the Policy Set Definition.
    managementGroupName String

    Supporting Types

    GetPolicySetDefinitionPolicyDefinitionGroup

    AdditionalMetadataResourceId string
    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_name is 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.
    AdditionalMetadataResourceId string
    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_name is 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.
    additionalMetadataResourceId String
    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_name is 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.
    additionalMetadataResourceId string
    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_name is 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_resource_id str
    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_name is 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.
    additionalMetadataResourceId String
    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_name is 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.
    PolicyDefinitionId string
    The ID of the policy definition or policy set definition that is included in this policy set definition.
    PolicyGroupNames List<string>
    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.
    PolicyDefinitionId string
    The ID of the policy definition or policy set definition that is included in this policy set definition.
    PolicyGroupNames []string
    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.
    policyDefinitionId String
    The ID of the policy definition or policy set definition that is included in this policy set definition.
    policyGroupNames List<String>
    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.
    policyDefinitionId string
    The ID of the policy definition or policy set definition that is included in this policy set definition.
    policyGroupNames string[]
    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_id str
    The ID of the policy definition or policy set definition that is included in this policy set definition.
    policy_group_names Sequence[str]
    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.
    policyDefinitionId String
    The ID of the policy definition or policy set definition that is included in this policy set definition.
    policyGroupNames List<String>
    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 azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi