/
identityGroup.go
318 lines (265 loc) · 10.6 KB
/
identityGroup.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
// 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 me
import (
"context"
"reflect"
"github.com/ovh/pulumi-ovh/sdk/go/ovh/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates an identity group.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/ovh/pulumi-ovh/sdk/go/ovh/Me"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Me.NewIdentityGroup(ctx, "myGroup", &Me.IdentityGroupArgs{
// Description: pulumi.String("Some custom description"),
// Role: pulumi.String("NONE"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
type IdentityGroup struct {
pulumi.CustomResourceState
// URN of the user group, used when writing IAM policies
GroupURN pulumi.StringOutput `pulumi:"GroupURN"`
// Creation date of this group.
Creation pulumi.StringOutput `pulumi:"creation"`
// Is the group a default and immutable one.
DefaultGroup pulumi.BoolOutput `pulumi:"defaultGroup"`
// Group description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Date of the last update of this group.
LastUpdate pulumi.StringOutput `pulumi:"lastUpdate"`
// Group name.
Name pulumi.StringOutput `pulumi:"name"`
// Role associated with the group. Valid roles are ADMIN, REGULAR, UNPRIVILEGED, and NONE.
Role pulumi.StringPtrOutput `pulumi:"role"`
}
// NewIdentityGroup registers a new resource with the given unique name, arguments, and options.
func NewIdentityGroup(ctx *pulumi.Context,
name string, args *IdentityGroupArgs, opts ...pulumi.ResourceOption) (*IdentityGroup, error) {
if args == nil {
args = &IdentityGroupArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource IdentityGroup
err := ctx.RegisterResource("ovh:Me/identityGroup:IdentityGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIdentityGroup gets an existing IdentityGroup 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 GetIdentityGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IdentityGroupState, opts ...pulumi.ResourceOption) (*IdentityGroup, error) {
var resource IdentityGroup
err := ctx.ReadResource("ovh:Me/identityGroup:IdentityGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IdentityGroup resources.
type identityGroupState struct {
// URN of the user group, used when writing IAM policies
GroupURN *string `pulumi:"GroupURN"`
// Creation date of this group.
Creation *string `pulumi:"creation"`
// Is the group a default and immutable one.
DefaultGroup *bool `pulumi:"defaultGroup"`
// Group description.
Description *string `pulumi:"description"`
// Date of the last update of this group.
LastUpdate *string `pulumi:"lastUpdate"`
// Group name.
Name *string `pulumi:"name"`
// Role associated with the group. Valid roles are ADMIN, REGULAR, UNPRIVILEGED, and NONE.
Role *string `pulumi:"role"`
}
type IdentityGroupState struct {
// URN of the user group, used when writing IAM policies
GroupURN pulumi.StringPtrInput
// Creation date of this group.
Creation pulumi.StringPtrInput
// Is the group a default and immutable one.
DefaultGroup pulumi.BoolPtrInput
// Group description.
Description pulumi.StringPtrInput
// Date of the last update of this group.
LastUpdate pulumi.StringPtrInput
// Group name.
Name pulumi.StringPtrInput
// Role associated with the group. Valid roles are ADMIN, REGULAR, UNPRIVILEGED, and NONE.
Role pulumi.StringPtrInput
}
func (IdentityGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*identityGroupState)(nil)).Elem()
}
type identityGroupArgs struct {
// Group description.
Description *string `pulumi:"description"`
// Group name.
Name *string `pulumi:"name"`
// Role associated with the group. Valid roles are ADMIN, REGULAR, UNPRIVILEGED, and NONE.
Role *string `pulumi:"role"`
}
// The set of arguments for constructing a IdentityGroup resource.
type IdentityGroupArgs struct {
// Group description.
Description pulumi.StringPtrInput
// Group name.
Name pulumi.StringPtrInput
// Role associated with the group. Valid roles are ADMIN, REGULAR, UNPRIVILEGED, and NONE.
Role pulumi.StringPtrInput
}
func (IdentityGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*identityGroupArgs)(nil)).Elem()
}
type IdentityGroupInput interface {
pulumi.Input
ToIdentityGroupOutput() IdentityGroupOutput
ToIdentityGroupOutputWithContext(ctx context.Context) IdentityGroupOutput
}
func (*IdentityGroup) ElementType() reflect.Type {
return reflect.TypeOf((**IdentityGroup)(nil)).Elem()
}
func (i *IdentityGroup) ToIdentityGroupOutput() IdentityGroupOutput {
return i.ToIdentityGroupOutputWithContext(context.Background())
}
func (i *IdentityGroup) ToIdentityGroupOutputWithContext(ctx context.Context) IdentityGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityGroupOutput)
}
// IdentityGroupArrayInput is an input type that accepts IdentityGroupArray and IdentityGroupArrayOutput values.
// You can construct a concrete instance of `IdentityGroupArrayInput` via:
//
// IdentityGroupArray{ IdentityGroupArgs{...} }
type IdentityGroupArrayInput interface {
pulumi.Input
ToIdentityGroupArrayOutput() IdentityGroupArrayOutput
ToIdentityGroupArrayOutputWithContext(context.Context) IdentityGroupArrayOutput
}
type IdentityGroupArray []IdentityGroupInput
func (IdentityGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IdentityGroup)(nil)).Elem()
}
func (i IdentityGroupArray) ToIdentityGroupArrayOutput() IdentityGroupArrayOutput {
return i.ToIdentityGroupArrayOutputWithContext(context.Background())
}
func (i IdentityGroupArray) ToIdentityGroupArrayOutputWithContext(ctx context.Context) IdentityGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityGroupArrayOutput)
}
// IdentityGroupMapInput is an input type that accepts IdentityGroupMap and IdentityGroupMapOutput values.
// You can construct a concrete instance of `IdentityGroupMapInput` via:
//
// IdentityGroupMap{ "key": IdentityGroupArgs{...} }
type IdentityGroupMapInput interface {
pulumi.Input
ToIdentityGroupMapOutput() IdentityGroupMapOutput
ToIdentityGroupMapOutputWithContext(context.Context) IdentityGroupMapOutput
}
type IdentityGroupMap map[string]IdentityGroupInput
func (IdentityGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IdentityGroup)(nil)).Elem()
}
func (i IdentityGroupMap) ToIdentityGroupMapOutput() IdentityGroupMapOutput {
return i.ToIdentityGroupMapOutputWithContext(context.Background())
}
func (i IdentityGroupMap) ToIdentityGroupMapOutputWithContext(ctx context.Context) IdentityGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityGroupMapOutput)
}
type IdentityGroupOutput struct{ *pulumi.OutputState }
func (IdentityGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**IdentityGroup)(nil)).Elem()
}
func (o IdentityGroupOutput) ToIdentityGroupOutput() IdentityGroupOutput {
return o
}
func (o IdentityGroupOutput) ToIdentityGroupOutputWithContext(ctx context.Context) IdentityGroupOutput {
return o
}
// URN of the user group, used when writing IAM policies
func (o IdentityGroupOutput) GroupURN() pulumi.StringOutput {
return o.ApplyT(func(v *IdentityGroup) pulumi.StringOutput { return v.GroupURN }).(pulumi.StringOutput)
}
// Creation date of this group.
func (o IdentityGroupOutput) Creation() pulumi.StringOutput {
return o.ApplyT(func(v *IdentityGroup) pulumi.StringOutput { return v.Creation }).(pulumi.StringOutput)
}
// Is the group a default and immutable one.
func (o IdentityGroupOutput) DefaultGroup() pulumi.BoolOutput {
return o.ApplyT(func(v *IdentityGroup) pulumi.BoolOutput { return v.DefaultGroup }).(pulumi.BoolOutput)
}
// Group description.
func (o IdentityGroupOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *IdentityGroup) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Date of the last update of this group.
func (o IdentityGroupOutput) LastUpdate() pulumi.StringOutput {
return o.ApplyT(func(v *IdentityGroup) pulumi.StringOutput { return v.LastUpdate }).(pulumi.StringOutput)
}
// Group name.
func (o IdentityGroupOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *IdentityGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Role associated with the group. Valid roles are ADMIN, REGULAR, UNPRIVILEGED, and NONE.
func (o IdentityGroupOutput) Role() pulumi.StringPtrOutput {
return o.ApplyT(func(v *IdentityGroup) pulumi.StringPtrOutput { return v.Role }).(pulumi.StringPtrOutput)
}
type IdentityGroupArrayOutput struct{ *pulumi.OutputState }
func (IdentityGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IdentityGroup)(nil)).Elem()
}
func (o IdentityGroupArrayOutput) ToIdentityGroupArrayOutput() IdentityGroupArrayOutput {
return o
}
func (o IdentityGroupArrayOutput) ToIdentityGroupArrayOutputWithContext(ctx context.Context) IdentityGroupArrayOutput {
return o
}
func (o IdentityGroupArrayOutput) Index(i pulumi.IntInput) IdentityGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IdentityGroup {
return vs[0].([]*IdentityGroup)[vs[1].(int)]
}).(IdentityGroupOutput)
}
type IdentityGroupMapOutput struct{ *pulumi.OutputState }
func (IdentityGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IdentityGroup)(nil)).Elem()
}
func (o IdentityGroupMapOutput) ToIdentityGroupMapOutput() IdentityGroupMapOutput {
return o
}
func (o IdentityGroupMapOutput) ToIdentityGroupMapOutputWithContext(ctx context.Context) IdentityGroupMapOutput {
return o
}
func (o IdentityGroupMapOutput) MapIndex(k pulumi.StringInput) IdentityGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IdentityGroup {
return vs[0].(map[string]*IdentityGroup)[vs[1].(string)]
}).(IdentityGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*IdentityGroupInput)(nil)).Elem(), &IdentityGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*IdentityGroupArrayInput)(nil)).Elem(), IdentityGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*IdentityGroupMapInput)(nil)).Elem(), IdentityGroupMap{})
pulumi.RegisterOutputType(IdentityGroupOutput{})
pulumi.RegisterOutputType(IdentityGroupArrayOutput{})
pulumi.RegisterOutputType(IdentityGroupMapOutput{})
}