Azure Classic
getPolicySetDefinition
Use this data source to access information about an existing Policy Set Definition.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.Policy.GetPolicySetDefinition.InvokeAsync(new Azure.Policy.GetPolicySetDefinitionArgs
{
DisplayName = "Policy Set Definition Example",
}));
this.Id = example.Apply(example => example.Id);
}
[Output("id")]
public Output<string> Id { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/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
})
}
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()));
}
}
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)
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);
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:
- Display
Name string Specifies the display name of the Policy Set Definition. Conflicts with
name
.- Management
Group 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 string Specifies the display name of the Policy Set Definition. Conflicts with
name
.- Management
Group 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 String Specifies the display name of the Policy Set Definition. Conflicts with
name
.- management
Group 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 string Specifies the display name of the Policy Set Definition. Conflicts with
name
.- management
Group 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
.- 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
.
- display
Name String Specifies the display name of the Policy Set Definition. Conflicts with
name
.- management
Group 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.
- Display
Name 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.
- Policy
Definition List<GetGroups Policy Set Definition Policy Definition Group> One or more
policy_definition_group
blocks as defined below.- Policy
Definition List<GetReferences Policy Set Definition Policy Definition Reference> One or more
policy_definition_reference
blocks as defined below.- Policy
Definitions string The policy definitions contained within the policy set definition.
- Policy
Type string The Type of the Policy Set Definition.
- Management
Group stringName
- Description string
The description of this policy definition group.
- Display
Name 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.
- Policy
Definition []GetGroups Policy Set Definition Policy Definition Group One or more
policy_definition_group
blocks as defined below.- Policy
Definition []GetReferences Policy Set Definition Policy Definition Reference One or more
policy_definition_reference
blocks as defined below.- Policy
Definitions string The policy definitions contained within the policy set definition.
- Policy
Type string The Type of the Policy Set Definition.
- Management
Group stringName
- description String
The description of this policy definition group.
- display
Name 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.
- policy
Definition List<GetGroups Policy Set Definition Policy Definition Group> One or more
policy_definition_group
blocks as defined below.- policy
Definition List<GetReferences Policy Set Definition Policy Definition Reference> One or more
policy_definition_reference
blocks as defined below.- policy
Definitions String The policy definitions contained within the policy set definition.
- policy
Type String The Type of the Policy Set Definition.
- management
Group StringName
- description string
The description of this policy definition group.
- display
Name 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.
- policy
Definition GetGroups Policy Set Definition Policy Definition Group[] One or more
policy_definition_group
blocks as defined below.- policy
Definition GetReferences Policy Set Definition Policy Definition Reference[] One or more
policy_definition_reference
blocks as defined below.- policy
Definitions string The policy definitions contained within the policy set definition.
- policy
Type string The Type of the Policy Set Definition.
- management
Group 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_group
blocks as defined below.- policy_
definition_ Sequence[Getreferences Policy Set Definition Policy Definition Reference] 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_ strname
- description String
The description of this policy definition group.
- display
Name 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.
- 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
Definitions String The policy definitions contained within the policy set definition.
- policy
Type String The Type of the Policy Set Definition.
- management
Group StringName
Supporting Types
GetPolicySetDefinitionPolicyDefinitionGroup
- 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 Specifies the display name of the Policy Set Definition. Conflicts with
name
.- Name string
Specifies the name of the Policy Set Definition. Conflicts with
display_name
.
- 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 Specifies the display name of the Policy Set Definition. Conflicts with
name
.- Name string
Specifies the name of the Policy Set Definition. Conflicts with
display_name
.
- 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 Specifies the display name of the Policy Set Definition. Conflicts with
name
.- name String
Specifies the name of the Policy Set Definition. Conflicts with
display_name
.
- 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 Specifies the display name of the Policy Set Definition. Conflicts with
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
.- name str
Specifies the name of the Policy Set Definition. Conflicts with
display_name
.
- 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 Specifies the display name of the Policy Set Definition. Conflicts with
name
.- name String
Specifies the name of the Policy Set Definition. Conflicts with
display_name
.
GetPolicySetDefinitionPolicyDefinitionReference
- Parameter
Values 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.
- Policy
Definition stringId The ID of the policy definition or policy set definition that is included in this policy set definition.
- Policy
Group List<string>Names The list of names of the policy definition groups that this policy definition reference belongs to.
- Reference
Id string The unique ID within this policy set definition for this policy definition reference.
- Parameter
Values 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.
- Policy
Definition stringId The ID of the policy definition or policy set definition that is included in this policy set definition.
- Policy
Group []stringNames The list of names of the policy definition groups that this policy definition reference belongs to.
- Reference
Id string The unique ID within this policy set definition for this policy definition reference.
- parameter
Values 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.
- policy
Definition StringId The ID of the policy definition or policy set definition that is included in this policy set definition.
- policy
Group List<String>Names The list of names of the policy definition groups that this policy definition reference belongs to.
- reference
Id String The unique ID within this policy set definition for this policy definition reference.
- parameter
Values 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.
- policy
Definition stringId The ID of the policy definition or policy set definition that is included in this policy set definition.
- policy
Group string[]Names The list of names of the policy definition groups that this policy definition reference belongs to.
- reference
Id 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.
- parameter
Values 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.
- policy
Definition StringId The ID of the policy definition or policy set definition that is included in this policy set definition.
- policy
Group List<String>Names The list of names of the policy definition groups that this policy definition reference belongs to.
- reference
Id String The unique ID within this policy set definition for this policy definition reference.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.