/
groupEntitlement.go
385 lines (332 loc) · 17.5 KB
/
groupEntitlement.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
// 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 azuredevops
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azuredevops/sdk/v2/go/azuredevops/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a group entitlement within Azure DevOps.
//
// ## Example Usage
//
// ### With an Azure DevOps local group managed by this resource
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v2/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := azuredevops.NewGroupEntitlement(ctx, "example", &azuredevops.GroupEntitlementArgs{
// DisplayName: pulumi.String("Group Name"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### With group origin ID
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v2/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := azuredevops.NewGroupEntitlement(ctx, "example", &azuredevops.GroupEntitlementArgs{
// Origin: pulumi.String("aad"),
// OriginId: pulumi.String("00000000-0000-0000-0000-000000000000"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Relevant Links
//
// - [Azure DevOps Service REST API 7.0 - Group Entitlements](https://learn.microsoft.com/en-us/rest/api/azure/devops/memberentitlementmanagement/group-entitlements?view=azure-devops-rest-7.1)
// - [Programmatic mapping of access levels](https://docs.microsoft.com/en-us/azure/devops/organizations/security/access-levels?view=azure-devops#programmatic-mapping-of-access-levels)
//
// ## PAT Permissions Required
//
// - **Member Entitlement Management**: Read & Write
//
// ## Import
//
// # The resource allows the import via the ID of a group entitlement, which is a
//
// UUID.
//
// ```sh
// $ pulumi import azuredevops:index/groupEntitlement:GroupEntitlement example 00000000-0000-0000-0000-000000000000
// ```
type GroupEntitlement struct {
pulumi.CustomResourceState
// Type of Account License. Valid values: `advanced`, `earlyAdopter`, `express`, `none`, `professional`, or `stakeholder`. Defaults to `express`. In addition, the value `basic` is allowed which is an alias for `express` and reflects the name of the `express` license used in the Azure DevOps web interface.
AccountLicenseType pulumi.StringPtrOutput `pulumi:"accountLicenseType"`
// The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the group graph subject.
Descriptor pulumi.StringOutput `pulumi:"descriptor"`
// The display name is the name used in Azure DevOps UI. Cannot be set together with `originId` and `origin`.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// The source of the licensing (e.g. Account. MSDN etc.) Valid values: `account` (Default), `auto`, `msdn`, `none`, `profile`, `trial`
//
// > **NOTE:** A existing group in Azure AD can only be referenced by the combination of `originId` and `origin`.
LicensingSource pulumi.StringPtrOutput `pulumi:"licensingSource"`
// The type of source provider for the origin identifier.
Origin pulumi.StringOutput `pulumi:"origin"`
// The unique identifier from the system of origin. Typically, a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
OriginId pulumi.StringOutput `pulumi:"originId"`
// The principal name of a graph member on Azure DevOps
PrincipalName pulumi.StringOutput `pulumi:"principalName"`
}
// NewGroupEntitlement registers a new resource with the given unique name, arguments, and options.
func NewGroupEntitlement(ctx *pulumi.Context,
name string, args *GroupEntitlementArgs, opts ...pulumi.ResourceOption) (*GroupEntitlement, error) {
if args == nil {
args = &GroupEntitlementArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource GroupEntitlement
err := ctx.RegisterResource("azuredevops:index/groupEntitlement:GroupEntitlement", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGroupEntitlement gets an existing GroupEntitlement resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGroupEntitlement(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GroupEntitlementState, opts ...pulumi.ResourceOption) (*GroupEntitlement, error) {
var resource GroupEntitlement
err := ctx.ReadResource("azuredevops:index/groupEntitlement:GroupEntitlement", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GroupEntitlement resources.
type groupEntitlementState struct {
// Type of Account License. Valid values: `advanced`, `earlyAdopter`, `express`, `none`, `professional`, or `stakeholder`. Defaults to `express`. In addition, the value `basic` is allowed which is an alias for `express` and reflects the name of the `express` license used in the Azure DevOps web interface.
AccountLicenseType *string `pulumi:"accountLicenseType"`
// The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the group graph subject.
Descriptor *string `pulumi:"descriptor"`
// The display name is the name used in Azure DevOps UI. Cannot be set together with `originId` and `origin`.
DisplayName *string `pulumi:"displayName"`
// The source of the licensing (e.g. Account. MSDN etc.) Valid values: `account` (Default), `auto`, `msdn`, `none`, `profile`, `trial`
//
// > **NOTE:** A existing group in Azure AD can only be referenced by the combination of `originId` and `origin`.
LicensingSource *string `pulumi:"licensingSource"`
// The type of source provider for the origin identifier.
Origin *string `pulumi:"origin"`
// The unique identifier from the system of origin. Typically, a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
OriginId *string `pulumi:"originId"`
// The principal name of a graph member on Azure DevOps
PrincipalName *string `pulumi:"principalName"`
}
type GroupEntitlementState struct {
// Type of Account License. Valid values: `advanced`, `earlyAdopter`, `express`, `none`, `professional`, or `stakeholder`. Defaults to `express`. In addition, the value `basic` is allowed which is an alias for `express` and reflects the name of the `express` license used in the Azure DevOps web interface.
AccountLicenseType pulumi.StringPtrInput
// The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the group graph subject.
Descriptor pulumi.StringPtrInput
// The display name is the name used in Azure DevOps UI. Cannot be set together with `originId` and `origin`.
DisplayName pulumi.StringPtrInput
// The source of the licensing (e.g. Account. MSDN etc.) Valid values: `account` (Default), `auto`, `msdn`, `none`, `profile`, `trial`
//
// > **NOTE:** A existing group in Azure AD can only be referenced by the combination of `originId` and `origin`.
LicensingSource pulumi.StringPtrInput
// The type of source provider for the origin identifier.
Origin pulumi.StringPtrInput
// The unique identifier from the system of origin. Typically, a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
OriginId pulumi.StringPtrInput
// The principal name of a graph member on Azure DevOps
PrincipalName pulumi.StringPtrInput
}
func (GroupEntitlementState) ElementType() reflect.Type {
return reflect.TypeOf((*groupEntitlementState)(nil)).Elem()
}
type groupEntitlementArgs struct {
// Type of Account License. Valid values: `advanced`, `earlyAdopter`, `express`, `none`, `professional`, or `stakeholder`. Defaults to `express`. In addition, the value `basic` is allowed which is an alias for `express` and reflects the name of the `express` license used in the Azure DevOps web interface.
AccountLicenseType *string `pulumi:"accountLicenseType"`
// The display name is the name used in Azure DevOps UI. Cannot be set together with `originId` and `origin`.
DisplayName *string `pulumi:"displayName"`
// The source of the licensing (e.g. Account. MSDN etc.) Valid values: `account` (Default), `auto`, `msdn`, `none`, `profile`, `trial`
//
// > **NOTE:** A existing group in Azure AD can only be referenced by the combination of `originId` and `origin`.
LicensingSource *string `pulumi:"licensingSource"`
// The type of source provider for the origin identifier.
Origin *string `pulumi:"origin"`
// The unique identifier from the system of origin. Typically, a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
OriginId *string `pulumi:"originId"`
}
// The set of arguments for constructing a GroupEntitlement resource.
type GroupEntitlementArgs struct {
// Type of Account License. Valid values: `advanced`, `earlyAdopter`, `express`, `none`, `professional`, or `stakeholder`. Defaults to `express`. In addition, the value `basic` is allowed which is an alias for `express` and reflects the name of the `express` license used in the Azure DevOps web interface.
AccountLicenseType pulumi.StringPtrInput
// The display name is the name used in Azure DevOps UI. Cannot be set together with `originId` and `origin`.
DisplayName pulumi.StringPtrInput
// The source of the licensing (e.g. Account. MSDN etc.) Valid values: `account` (Default), `auto`, `msdn`, `none`, `profile`, `trial`
//
// > **NOTE:** A existing group in Azure AD can only be referenced by the combination of `originId` and `origin`.
LicensingSource pulumi.StringPtrInput
// The type of source provider for the origin identifier.
Origin pulumi.StringPtrInput
// The unique identifier from the system of origin. Typically, a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
OriginId pulumi.StringPtrInput
}
func (GroupEntitlementArgs) ElementType() reflect.Type {
return reflect.TypeOf((*groupEntitlementArgs)(nil)).Elem()
}
type GroupEntitlementInput interface {
pulumi.Input
ToGroupEntitlementOutput() GroupEntitlementOutput
ToGroupEntitlementOutputWithContext(ctx context.Context) GroupEntitlementOutput
}
func (*GroupEntitlement) ElementType() reflect.Type {
return reflect.TypeOf((**GroupEntitlement)(nil)).Elem()
}
func (i *GroupEntitlement) ToGroupEntitlementOutput() GroupEntitlementOutput {
return i.ToGroupEntitlementOutputWithContext(context.Background())
}
func (i *GroupEntitlement) ToGroupEntitlementOutputWithContext(ctx context.Context) GroupEntitlementOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupEntitlementOutput)
}
// GroupEntitlementArrayInput is an input type that accepts GroupEntitlementArray and GroupEntitlementArrayOutput values.
// You can construct a concrete instance of `GroupEntitlementArrayInput` via:
//
// GroupEntitlementArray{ GroupEntitlementArgs{...} }
type GroupEntitlementArrayInput interface {
pulumi.Input
ToGroupEntitlementArrayOutput() GroupEntitlementArrayOutput
ToGroupEntitlementArrayOutputWithContext(context.Context) GroupEntitlementArrayOutput
}
type GroupEntitlementArray []GroupEntitlementInput
func (GroupEntitlementArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GroupEntitlement)(nil)).Elem()
}
func (i GroupEntitlementArray) ToGroupEntitlementArrayOutput() GroupEntitlementArrayOutput {
return i.ToGroupEntitlementArrayOutputWithContext(context.Background())
}
func (i GroupEntitlementArray) ToGroupEntitlementArrayOutputWithContext(ctx context.Context) GroupEntitlementArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupEntitlementArrayOutput)
}
// GroupEntitlementMapInput is an input type that accepts GroupEntitlementMap and GroupEntitlementMapOutput values.
// You can construct a concrete instance of `GroupEntitlementMapInput` via:
//
// GroupEntitlementMap{ "key": GroupEntitlementArgs{...} }
type GroupEntitlementMapInput interface {
pulumi.Input
ToGroupEntitlementMapOutput() GroupEntitlementMapOutput
ToGroupEntitlementMapOutputWithContext(context.Context) GroupEntitlementMapOutput
}
type GroupEntitlementMap map[string]GroupEntitlementInput
func (GroupEntitlementMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GroupEntitlement)(nil)).Elem()
}
func (i GroupEntitlementMap) ToGroupEntitlementMapOutput() GroupEntitlementMapOutput {
return i.ToGroupEntitlementMapOutputWithContext(context.Background())
}
func (i GroupEntitlementMap) ToGroupEntitlementMapOutputWithContext(ctx context.Context) GroupEntitlementMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupEntitlementMapOutput)
}
type GroupEntitlementOutput struct{ *pulumi.OutputState }
func (GroupEntitlementOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GroupEntitlement)(nil)).Elem()
}
func (o GroupEntitlementOutput) ToGroupEntitlementOutput() GroupEntitlementOutput {
return o
}
func (o GroupEntitlementOutput) ToGroupEntitlementOutputWithContext(ctx context.Context) GroupEntitlementOutput {
return o
}
// Type of Account License. Valid values: `advanced`, `earlyAdopter`, `express`, `none`, `professional`, or `stakeholder`. Defaults to `express`. In addition, the value `basic` is allowed which is an alias for `express` and reflects the name of the `express` license used in the Azure DevOps web interface.
func (o GroupEntitlementOutput) AccountLicenseType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GroupEntitlement) pulumi.StringPtrOutput { return v.AccountLicenseType }).(pulumi.StringPtrOutput)
}
// The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the group graph subject.
func (o GroupEntitlementOutput) Descriptor() pulumi.StringOutput {
return o.ApplyT(func(v *GroupEntitlement) pulumi.StringOutput { return v.Descriptor }).(pulumi.StringOutput)
}
// The display name is the name used in Azure DevOps UI. Cannot be set together with `originId` and `origin`.
func (o GroupEntitlementOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *GroupEntitlement) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// The source of the licensing (e.g. Account. MSDN etc.) Valid values: `account` (Default), `auto`, `msdn`, `none`, `profile`, `trial`
//
// > **NOTE:** A existing group in Azure AD can only be referenced by the combination of `originId` and `origin`.
func (o GroupEntitlementOutput) LicensingSource() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GroupEntitlement) pulumi.StringPtrOutput { return v.LicensingSource }).(pulumi.StringPtrOutput)
}
// The type of source provider for the origin identifier.
func (o GroupEntitlementOutput) Origin() pulumi.StringOutput {
return o.ApplyT(func(v *GroupEntitlement) pulumi.StringOutput { return v.Origin }).(pulumi.StringOutput)
}
// The unique identifier from the system of origin. Typically, a sid, object id or Guid. e.g. Used for member of other tenant on Azure Active Directory.
func (o GroupEntitlementOutput) OriginId() pulumi.StringOutput {
return o.ApplyT(func(v *GroupEntitlement) pulumi.StringOutput { return v.OriginId }).(pulumi.StringOutput)
}
// The principal name of a graph member on Azure DevOps
func (o GroupEntitlementOutput) PrincipalName() pulumi.StringOutput {
return o.ApplyT(func(v *GroupEntitlement) pulumi.StringOutput { return v.PrincipalName }).(pulumi.StringOutput)
}
type GroupEntitlementArrayOutput struct{ *pulumi.OutputState }
func (GroupEntitlementArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GroupEntitlement)(nil)).Elem()
}
func (o GroupEntitlementArrayOutput) ToGroupEntitlementArrayOutput() GroupEntitlementArrayOutput {
return o
}
func (o GroupEntitlementArrayOutput) ToGroupEntitlementArrayOutputWithContext(ctx context.Context) GroupEntitlementArrayOutput {
return o
}
func (o GroupEntitlementArrayOutput) Index(i pulumi.IntInput) GroupEntitlementOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GroupEntitlement {
return vs[0].([]*GroupEntitlement)[vs[1].(int)]
}).(GroupEntitlementOutput)
}
type GroupEntitlementMapOutput struct{ *pulumi.OutputState }
func (GroupEntitlementMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GroupEntitlement)(nil)).Elem()
}
func (o GroupEntitlementMapOutput) ToGroupEntitlementMapOutput() GroupEntitlementMapOutput {
return o
}
func (o GroupEntitlementMapOutput) ToGroupEntitlementMapOutputWithContext(ctx context.Context) GroupEntitlementMapOutput {
return o
}
func (o GroupEntitlementMapOutput) MapIndex(k pulumi.StringInput) GroupEntitlementOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GroupEntitlement {
return vs[0].(map[string]*GroupEntitlement)[vs[1].(string)]
}).(GroupEntitlementOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GroupEntitlementInput)(nil)).Elem(), &GroupEntitlement{})
pulumi.RegisterInputType(reflect.TypeOf((*GroupEntitlementArrayInput)(nil)).Elem(), GroupEntitlementArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GroupEntitlementMapInput)(nil)).Elem(), GroupEntitlementMap{})
pulumi.RegisterOutputType(GroupEntitlementOutput{})
pulumi.RegisterOutputType(GroupEntitlementArrayOutput{})
pulumi.RegisterOutputType(GroupEntitlementMapOutput{})
}