generated from pulumi/pulumi-tf-provider-boilerplate
/
authConfigPing.go
490 lines (429 loc) · 19 KB
/
authConfigPing.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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
// 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 rancher2
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Rancher v2 Auth Config Ping resource. This can be used to configure and enable Auth Config Ping for Rancher v2 RKE clusters and retrieve their information.
//
// In addition to the built-in local auth, only one external auth config provider can be enabled at a time.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-rancher2/sdk/v4/go/rancher2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := rancher2.NewAuthConfigPing(ctx, "ping", &rancher2.AuthConfigPingArgs{
// DisplayNameField: pulumi.String("<DISPLAY_NAME_FIELD>"),
// GroupsField: pulumi.String("<GROUPS_FIELD>"),
// IdpMetadataContent: pulumi.String("<IDP_METADATA_CONTENT>"),
// RancherApiHost: pulumi.String("https://<RANCHER_API_HOST>"),
// SpCert: pulumi.String("<SP_CERT>"),
// SpKey: pulumi.String("<SP_KEY>"),
// UidField: pulumi.String("<UID_FIELD>"),
// UserNameField: pulumi.String("<USER_NAME_FIELD>"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
type AuthConfigPing struct {
pulumi.CustomResourceState
// Access mode for auth. `required`, `restricted`, `unrestricted` are supported. Default `unrestricted` (string)
AccessMode pulumi.StringPtrOutput `pulumi:"accessMode"`
// Allowed principal ids for auth. Required if `accessMode` is `required` or `restricted`. Ex: `ping_user://<USER_ID>` `ping_group://<GROUP_ID>` (list)
AllowedPrincipalIds pulumi.StringArrayOutput `pulumi:"allowedPrincipalIds"`
// Annotations of the resource (map)
Annotations pulumi.MapOutput `pulumi:"annotations"`
// Ping display name field (string)
DisplayNameField pulumi.StringOutput `pulumi:"displayNameField"`
// Enable auth config provider. Default `true` (bool)
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// Ping group field (string)
GroupsField pulumi.StringOutput `pulumi:"groupsField"`
// Ping IDP metadata content (string)
IdpMetadataContent pulumi.StringOutput `pulumi:"idpMetadataContent"`
// Labels of the resource (map)
Labels pulumi.MapOutput `pulumi:"labels"`
// (Computed) The name of the resource (string)
Name pulumi.StringOutput `pulumi:"name"`
// Rancher URL. URL scheme needs to be specified, `https://<RANCHER_API_HOST>` (string)
RancherApiHost pulumi.StringOutput `pulumi:"rancherApiHost"`
// Ping SP cert (string)
SpCert pulumi.StringOutput `pulumi:"spCert"`
// Ping SP key (string)
SpKey pulumi.StringOutput `pulumi:"spKey"`
// (Computed) The type of the resource (string)
Type pulumi.StringOutput `pulumi:"type"`
// Ping UID field (string)
UidField pulumi.StringOutput `pulumi:"uidField"`
// Ping user name field (string)
UserNameField pulumi.StringOutput `pulumi:"userNameField"`
}
// NewAuthConfigPing registers a new resource with the given unique name, arguments, and options.
func NewAuthConfigPing(ctx *pulumi.Context,
name string, args *AuthConfigPingArgs, opts ...pulumi.ResourceOption) (*AuthConfigPing, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DisplayNameField == nil {
return nil, errors.New("invalid value for required argument 'DisplayNameField'")
}
if args.GroupsField == nil {
return nil, errors.New("invalid value for required argument 'GroupsField'")
}
if args.IdpMetadataContent == nil {
return nil, errors.New("invalid value for required argument 'IdpMetadataContent'")
}
if args.RancherApiHost == nil {
return nil, errors.New("invalid value for required argument 'RancherApiHost'")
}
if args.SpCert == nil {
return nil, errors.New("invalid value for required argument 'SpCert'")
}
if args.SpKey == nil {
return nil, errors.New("invalid value for required argument 'SpKey'")
}
if args.UidField == nil {
return nil, errors.New("invalid value for required argument 'UidField'")
}
if args.UserNameField == nil {
return nil, errors.New("invalid value for required argument 'UserNameField'")
}
if args.IdpMetadataContent != nil {
args.IdpMetadataContent = pulumi.ToSecret(args.IdpMetadataContent).(pulumi.StringInput)
}
if args.SpCert != nil {
args.SpCert = pulumi.ToSecret(args.SpCert).(pulumi.StringInput)
}
if args.SpKey != nil {
args.SpKey = pulumi.ToSecret(args.SpKey).(pulumi.StringInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"idpMetadataContent",
"spCert",
"spKey",
})
opts = append(opts, secrets)
var resource AuthConfigPing
err := ctx.RegisterResource("rancher2:index/authConfigPing:AuthConfigPing", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAuthConfigPing gets an existing AuthConfigPing 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 GetAuthConfigPing(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AuthConfigPingState, opts ...pulumi.ResourceOption) (*AuthConfigPing, error) {
var resource AuthConfigPing
err := ctx.ReadResource("rancher2:index/authConfigPing:AuthConfigPing", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AuthConfigPing resources.
type authConfigPingState struct {
// Access mode for auth. `required`, `restricted`, `unrestricted` are supported. Default `unrestricted` (string)
AccessMode *string `pulumi:"accessMode"`
// Allowed principal ids for auth. Required if `accessMode` is `required` or `restricted`. Ex: `ping_user://<USER_ID>` `ping_group://<GROUP_ID>` (list)
AllowedPrincipalIds []string `pulumi:"allowedPrincipalIds"`
// Annotations of the resource (map)
Annotations map[string]interface{} `pulumi:"annotations"`
// Ping display name field (string)
DisplayNameField *string `pulumi:"displayNameField"`
// Enable auth config provider. Default `true` (bool)
Enabled *bool `pulumi:"enabled"`
// Ping group field (string)
GroupsField *string `pulumi:"groupsField"`
// Ping IDP metadata content (string)
IdpMetadataContent *string `pulumi:"idpMetadataContent"`
// Labels of the resource (map)
Labels map[string]interface{} `pulumi:"labels"`
// (Computed) The name of the resource (string)
Name *string `pulumi:"name"`
// Rancher URL. URL scheme needs to be specified, `https://<RANCHER_API_HOST>` (string)
RancherApiHost *string `pulumi:"rancherApiHost"`
// Ping SP cert (string)
SpCert *string `pulumi:"spCert"`
// Ping SP key (string)
SpKey *string `pulumi:"spKey"`
// (Computed) The type of the resource (string)
Type *string `pulumi:"type"`
// Ping UID field (string)
UidField *string `pulumi:"uidField"`
// Ping user name field (string)
UserNameField *string `pulumi:"userNameField"`
}
type AuthConfigPingState struct {
// Access mode for auth. `required`, `restricted`, `unrestricted` are supported. Default `unrestricted` (string)
AccessMode pulumi.StringPtrInput
// Allowed principal ids for auth. Required if `accessMode` is `required` or `restricted`. Ex: `ping_user://<USER_ID>` `ping_group://<GROUP_ID>` (list)
AllowedPrincipalIds pulumi.StringArrayInput
// Annotations of the resource (map)
Annotations pulumi.MapInput
// Ping display name field (string)
DisplayNameField pulumi.StringPtrInput
// Enable auth config provider. Default `true` (bool)
Enabled pulumi.BoolPtrInput
// Ping group field (string)
GroupsField pulumi.StringPtrInput
// Ping IDP metadata content (string)
IdpMetadataContent pulumi.StringPtrInput
// Labels of the resource (map)
Labels pulumi.MapInput
// (Computed) The name of the resource (string)
Name pulumi.StringPtrInput
// Rancher URL. URL scheme needs to be specified, `https://<RANCHER_API_HOST>` (string)
RancherApiHost pulumi.StringPtrInput
// Ping SP cert (string)
SpCert pulumi.StringPtrInput
// Ping SP key (string)
SpKey pulumi.StringPtrInput
// (Computed) The type of the resource (string)
Type pulumi.StringPtrInput
// Ping UID field (string)
UidField pulumi.StringPtrInput
// Ping user name field (string)
UserNameField pulumi.StringPtrInput
}
func (AuthConfigPingState) ElementType() reflect.Type {
return reflect.TypeOf((*authConfigPingState)(nil)).Elem()
}
type authConfigPingArgs struct {
// Access mode for auth. `required`, `restricted`, `unrestricted` are supported. Default `unrestricted` (string)
AccessMode *string `pulumi:"accessMode"`
// Allowed principal ids for auth. Required if `accessMode` is `required` or `restricted`. Ex: `ping_user://<USER_ID>` `ping_group://<GROUP_ID>` (list)
AllowedPrincipalIds []string `pulumi:"allowedPrincipalIds"`
// Annotations of the resource (map)
Annotations map[string]interface{} `pulumi:"annotations"`
// Ping display name field (string)
DisplayNameField string `pulumi:"displayNameField"`
// Enable auth config provider. Default `true` (bool)
Enabled *bool `pulumi:"enabled"`
// Ping group field (string)
GroupsField string `pulumi:"groupsField"`
// Ping IDP metadata content (string)
IdpMetadataContent string `pulumi:"idpMetadataContent"`
// Labels of the resource (map)
Labels map[string]interface{} `pulumi:"labels"`
// Rancher URL. URL scheme needs to be specified, `https://<RANCHER_API_HOST>` (string)
RancherApiHost string `pulumi:"rancherApiHost"`
// Ping SP cert (string)
SpCert string `pulumi:"spCert"`
// Ping SP key (string)
SpKey string `pulumi:"spKey"`
// Ping UID field (string)
UidField string `pulumi:"uidField"`
// Ping user name field (string)
UserNameField string `pulumi:"userNameField"`
}
// The set of arguments for constructing a AuthConfigPing resource.
type AuthConfigPingArgs struct {
// Access mode for auth. `required`, `restricted`, `unrestricted` are supported. Default `unrestricted` (string)
AccessMode pulumi.StringPtrInput
// Allowed principal ids for auth. Required if `accessMode` is `required` or `restricted`. Ex: `ping_user://<USER_ID>` `ping_group://<GROUP_ID>` (list)
AllowedPrincipalIds pulumi.StringArrayInput
// Annotations of the resource (map)
Annotations pulumi.MapInput
// Ping display name field (string)
DisplayNameField pulumi.StringInput
// Enable auth config provider. Default `true` (bool)
Enabled pulumi.BoolPtrInput
// Ping group field (string)
GroupsField pulumi.StringInput
// Ping IDP metadata content (string)
IdpMetadataContent pulumi.StringInput
// Labels of the resource (map)
Labels pulumi.MapInput
// Rancher URL. URL scheme needs to be specified, `https://<RANCHER_API_HOST>` (string)
RancherApiHost pulumi.StringInput
// Ping SP cert (string)
SpCert pulumi.StringInput
// Ping SP key (string)
SpKey pulumi.StringInput
// Ping UID field (string)
UidField pulumi.StringInput
// Ping user name field (string)
UserNameField pulumi.StringInput
}
func (AuthConfigPingArgs) ElementType() reflect.Type {
return reflect.TypeOf((*authConfigPingArgs)(nil)).Elem()
}
type AuthConfigPingInput interface {
pulumi.Input
ToAuthConfigPingOutput() AuthConfigPingOutput
ToAuthConfigPingOutputWithContext(ctx context.Context) AuthConfigPingOutput
}
func (*AuthConfigPing) ElementType() reflect.Type {
return reflect.TypeOf((**AuthConfigPing)(nil)).Elem()
}
func (i *AuthConfigPing) ToAuthConfigPingOutput() AuthConfigPingOutput {
return i.ToAuthConfigPingOutputWithContext(context.Background())
}
func (i *AuthConfigPing) ToAuthConfigPingOutputWithContext(ctx context.Context) AuthConfigPingOutput {
return pulumi.ToOutputWithContext(ctx, i).(AuthConfigPingOutput)
}
// AuthConfigPingArrayInput is an input type that accepts AuthConfigPingArray and AuthConfigPingArrayOutput values.
// You can construct a concrete instance of `AuthConfigPingArrayInput` via:
//
// AuthConfigPingArray{ AuthConfigPingArgs{...} }
type AuthConfigPingArrayInput interface {
pulumi.Input
ToAuthConfigPingArrayOutput() AuthConfigPingArrayOutput
ToAuthConfigPingArrayOutputWithContext(context.Context) AuthConfigPingArrayOutput
}
type AuthConfigPingArray []AuthConfigPingInput
func (AuthConfigPingArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AuthConfigPing)(nil)).Elem()
}
func (i AuthConfigPingArray) ToAuthConfigPingArrayOutput() AuthConfigPingArrayOutput {
return i.ToAuthConfigPingArrayOutputWithContext(context.Background())
}
func (i AuthConfigPingArray) ToAuthConfigPingArrayOutputWithContext(ctx context.Context) AuthConfigPingArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AuthConfigPingArrayOutput)
}
// AuthConfigPingMapInput is an input type that accepts AuthConfigPingMap and AuthConfigPingMapOutput values.
// You can construct a concrete instance of `AuthConfigPingMapInput` via:
//
// AuthConfigPingMap{ "key": AuthConfigPingArgs{...} }
type AuthConfigPingMapInput interface {
pulumi.Input
ToAuthConfigPingMapOutput() AuthConfigPingMapOutput
ToAuthConfigPingMapOutputWithContext(context.Context) AuthConfigPingMapOutput
}
type AuthConfigPingMap map[string]AuthConfigPingInput
func (AuthConfigPingMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AuthConfigPing)(nil)).Elem()
}
func (i AuthConfigPingMap) ToAuthConfigPingMapOutput() AuthConfigPingMapOutput {
return i.ToAuthConfigPingMapOutputWithContext(context.Background())
}
func (i AuthConfigPingMap) ToAuthConfigPingMapOutputWithContext(ctx context.Context) AuthConfigPingMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AuthConfigPingMapOutput)
}
type AuthConfigPingOutput struct{ *pulumi.OutputState }
func (AuthConfigPingOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AuthConfigPing)(nil)).Elem()
}
func (o AuthConfigPingOutput) ToAuthConfigPingOutput() AuthConfigPingOutput {
return o
}
func (o AuthConfigPingOutput) ToAuthConfigPingOutputWithContext(ctx context.Context) AuthConfigPingOutput {
return o
}
// Access mode for auth. `required`, `restricted`, `unrestricted` are supported. Default `unrestricted` (string)
func (o AuthConfigPingOutput) AccessMode() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringPtrOutput { return v.AccessMode }).(pulumi.StringPtrOutput)
}
// Allowed principal ids for auth. Required if `accessMode` is `required` or `restricted`. Ex: `ping_user://<USER_ID>` `ping_group://<GROUP_ID>` (list)
func (o AuthConfigPingOutput) AllowedPrincipalIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringArrayOutput { return v.AllowedPrincipalIds }).(pulumi.StringArrayOutput)
}
// Annotations of the resource (map)
func (o AuthConfigPingOutput) Annotations() pulumi.MapOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.MapOutput { return v.Annotations }).(pulumi.MapOutput)
}
// Ping display name field (string)
func (o AuthConfigPingOutput) DisplayNameField() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.DisplayNameField }).(pulumi.StringOutput)
}
// Enable auth config provider. Default `true` (bool)
func (o AuthConfigPingOutput) Enabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
}
// Ping group field (string)
func (o AuthConfigPingOutput) GroupsField() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.GroupsField }).(pulumi.StringOutput)
}
// Ping IDP metadata content (string)
func (o AuthConfigPingOutput) IdpMetadataContent() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.IdpMetadataContent }).(pulumi.StringOutput)
}
// Labels of the resource (map)
func (o AuthConfigPingOutput) Labels() pulumi.MapOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.MapOutput { return v.Labels }).(pulumi.MapOutput)
}
// (Computed) The name of the resource (string)
func (o AuthConfigPingOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Rancher URL. URL scheme needs to be specified, `https://<RANCHER_API_HOST>` (string)
func (o AuthConfigPingOutput) RancherApiHost() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.RancherApiHost }).(pulumi.StringOutput)
}
// Ping SP cert (string)
func (o AuthConfigPingOutput) SpCert() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.SpCert }).(pulumi.StringOutput)
}
// Ping SP key (string)
func (o AuthConfigPingOutput) SpKey() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.SpKey }).(pulumi.StringOutput)
}
// (Computed) The type of the resource (string)
func (o AuthConfigPingOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// Ping UID field (string)
func (o AuthConfigPingOutput) UidField() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.UidField }).(pulumi.StringOutput)
}
// Ping user name field (string)
func (o AuthConfigPingOutput) UserNameField() pulumi.StringOutput {
return o.ApplyT(func(v *AuthConfigPing) pulumi.StringOutput { return v.UserNameField }).(pulumi.StringOutput)
}
type AuthConfigPingArrayOutput struct{ *pulumi.OutputState }
func (AuthConfigPingArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AuthConfigPing)(nil)).Elem()
}
func (o AuthConfigPingArrayOutput) ToAuthConfigPingArrayOutput() AuthConfigPingArrayOutput {
return o
}
func (o AuthConfigPingArrayOutput) ToAuthConfigPingArrayOutputWithContext(ctx context.Context) AuthConfigPingArrayOutput {
return o
}
func (o AuthConfigPingArrayOutput) Index(i pulumi.IntInput) AuthConfigPingOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AuthConfigPing {
return vs[0].([]*AuthConfigPing)[vs[1].(int)]
}).(AuthConfigPingOutput)
}
type AuthConfigPingMapOutput struct{ *pulumi.OutputState }
func (AuthConfigPingMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AuthConfigPing)(nil)).Elem()
}
func (o AuthConfigPingMapOutput) ToAuthConfigPingMapOutput() AuthConfigPingMapOutput {
return o
}
func (o AuthConfigPingMapOutput) ToAuthConfigPingMapOutputWithContext(ctx context.Context) AuthConfigPingMapOutput {
return o
}
func (o AuthConfigPingMapOutput) MapIndex(k pulumi.StringInput) AuthConfigPingOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AuthConfigPing {
return vs[0].(map[string]*AuthConfigPing)[vs[1].(string)]
}).(AuthConfigPingOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AuthConfigPingInput)(nil)).Elem(), &AuthConfigPing{})
pulumi.RegisterInputType(reflect.TypeOf((*AuthConfigPingArrayInput)(nil)).Elem(), AuthConfigPingArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AuthConfigPingMapInput)(nil)).Elem(), AuthConfigPingMap{})
pulumi.RegisterOutputType(AuthConfigPingOutput{})
pulumi.RegisterOutputType(AuthConfigPingArrayOutput{})
pulumi.RegisterOutputType(AuthConfigPingMapOutput{})
}