-
Notifications
You must be signed in to change notification settings - Fork 50
/
getPolicySetDefinition.go
193 lines (168 loc) · 8.25 KB
/
getPolicySetDefinition.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package policy
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Policy Set Definition.
//
// ## Example Usage
//
// ```go
// 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
// })
// }
//
// ```
func LookupPolicySetDefinition(ctx *pulumi.Context, args *LookupPolicySetDefinitionArgs, opts ...pulumi.InvokeOption) (*LookupPolicySetDefinitionResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupPolicySetDefinitionResult
err := ctx.Invoke("azure:policy/getPolicySetDefinition:getPolicySetDefinition", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getPolicySetDefinition.
type LookupPolicySetDefinitionArgs struct {
// Specifies the display name of the Policy Set Definition. Conflicts with `name`.
//
// **NOTE** As `displayName` is not unique errors may occur when there are multiple policy set definitions with same display name.
DisplayName *string `pulumi:"displayName"`
// Only retrieve Policy Set Definitions from this Management Group.
ManagementGroupName *string `pulumi:"managementGroupName"`
// Specifies the name of the Policy Set Definition. Conflicts with `displayName`.
Name *string `pulumi:"name"`
}
// A collection of values returned by getPolicySetDefinition.
type LookupPolicySetDefinitionResult struct {
// The description of this policy definition group.
Description string `pulumi:"description"`
// The display name of this policy definition group.
DisplayName string `pulumi:"displayName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
ManagementGroupName *string `pulumi:"managementGroupName"`
// Any Metadata defined in the Policy Set Definition.
Metadata string `pulumi:"metadata"`
// The name of this policy definition group.
Name string `pulumi:"name"`
// The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
Parameters string `pulumi:"parameters"`
// One or more `policyDefinitionGroup` blocks as defined below.
PolicyDefinitionGroups []GetPolicySetDefinitionPolicyDefinitionGroup `pulumi:"policyDefinitionGroups"`
// One or more `policyDefinitionReference` blocks as defined below.
PolicyDefinitionReferences []GetPolicySetDefinitionPolicyDefinitionReference `pulumi:"policyDefinitionReferences"`
// The policy definitions contained within the policy set definition.
PolicyDefinitions string `pulumi:"policyDefinitions"`
// The Type of the Policy Set Definition.
PolicyType string `pulumi:"policyType"`
}
func LookupPolicySetDefinitionOutput(ctx *pulumi.Context, args LookupPolicySetDefinitionOutputArgs, opts ...pulumi.InvokeOption) LookupPolicySetDefinitionResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupPolicySetDefinitionResult, error) {
args := v.(LookupPolicySetDefinitionArgs)
r, err := LookupPolicySetDefinition(ctx, &args, opts...)
var s LookupPolicySetDefinitionResult
if r != nil {
s = *r
}
return s, err
}).(LookupPolicySetDefinitionResultOutput)
}
// A collection of arguments for invoking getPolicySetDefinition.
type LookupPolicySetDefinitionOutputArgs struct {
// Specifies the display name of the Policy Set Definition. Conflicts with `name`.
//
// **NOTE** As `displayName` is not unique errors may occur when there are multiple policy set definitions with same display name.
DisplayName pulumi.StringPtrInput `pulumi:"displayName"`
// Only retrieve Policy Set Definitions from this Management Group.
ManagementGroupName pulumi.StringPtrInput `pulumi:"managementGroupName"`
// Specifies the name of the Policy Set Definition. Conflicts with `displayName`.
Name pulumi.StringPtrInput `pulumi:"name"`
}
func (LookupPolicySetDefinitionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupPolicySetDefinitionArgs)(nil)).Elem()
}
// A collection of values returned by getPolicySetDefinition.
type LookupPolicySetDefinitionResultOutput struct{ *pulumi.OutputState }
func (LookupPolicySetDefinitionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupPolicySetDefinitionResult)(nil)).Elem()
}
func (o LookupPolicySetDefinitionResultOutput) ToLookupPolicySetDefinitionResultOutput() LookupPolicySetDefinitionResultOutput {
return o
}
func (o LookupPolicySetDefinitionResultOutput) ToLookupPolicySetDefinitionResultOutputWithContext(ctx context.Context) LookupPolicySetDefinitionResultOutput {
return o
}
// The description of this policy definition group.
func (o LookupPolicySetDefinitionResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) string { return v.Description }).(pulumi.StringOutput)
}
// The display name of this policy definition group.
func (o LookupPolicySetDefinitionResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupPolicySetDefinitionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupPolicySetDefinitionResultOutput) ManagementGroupName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) *string { return v.ManagementGroupName }).(pulumi.StringPtrOutput)
}
// Any Metadata defined in the Policy Set Definition.
func (o LookupPolicySetDefinitionResultOutput) Metadata() pulumi.StringOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) string { return v.Metadata }).(pulumi.StringOutput)
}
// The name of this policy definition group.
func (o LookupPolicySetDefinitionResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) string { return v.Name }).(pulumi.StringOutput)
}
// The mapping of the parameter values for the referenced policy rule. The keys are the parameter names.
func (o LookupPolicySetDefinitionResultOutput) Parameters() pulumi.StringOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) string { return v.Parameters }).(pulumi.StringOutput)
}
// One or more `policyDefinitionGroup` blocks as defined below.
func (o LookupPolicySetDefinitionResultOutput) PolicyDefinitionGroups() GetPolicySetDefinitionPolicyDefinitionGroupArrayOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) []GetPolicySetDefinitionPolicyDefinitionGroup {
return v.PolicyDefinitionGroups
}).(GetPolicySetDefinitionPolicyDefinitionGroupArrayOutput)
}
// One or more `policyDefinitionReference` blocks as defined below.
func (o LookupPolicySetDefinitionResultOutput) PolicyDefinitionReferences() GetPolicySetDefinitionPolicyDefinitionReferenceArrayOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) []GetPolicySetDefinitionPolicyDefinitionReference {
return v.PolicyDefinitionReferences
}).(GetPolicySetDefinitionPolicyDefinitionReferenceArrayOutput)
}
// The policy definitions contained within the policy set definition.
func (o LookupPolicySetDefinitionResultOutput) PolicyDefinitions() pulumi.StringOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) string { return v.PolicyDefinitions }).(pulumi.StringOutput)
}
// The Type of the Policy Set Definition.
func (o LookupPolicySetDefinitionResultOutput) PolicyType() pulumi.StringOutput {
return o.ApplyT(func(v LookupPolicySetDefinitionResult) string { return v.PolicyType }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupPolicySetDefinitionResultOutput{})
}