/
authBackend.go
421 lines (360 loc) · 15.6 KB
/
authBackend.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package vault
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-vault/sdk/v4/go/vault"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := vault.NewAuthBackend(ctx, "example", &vault.AuthBackendArgs{
// Tune: &AuthBackendTuneArgs{
// ListingVisibility: pulumi.String("unauth"),
// MaxLeaseTtl: pulumi.String("90000s"),
// },
// Type: pulumi.String("github"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Auth methods can be imported using the `path`, e.g.
//
// ```sh
// $ pulumi import vault:index/authBackend:AuthBackend example github
// ```
type AuthBackend struct {
pulumi.CustomResourceState
// The accessor for this auth method
Accessor pulumi.StringOutput `pulumi:"accessor"`
// (Optional; Deprecated, use `tune.default_lease_ttl` if you are using Vault provider version >= 1.8) The default lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
DefaultLeaseTtlSeconds pulumi.IntOutput `pulumi:"defaultLeaseTtlSeconds"`
// A description of the auth method
Description pulumi.StringPtrOutput `pulumi:"description"`
// Specifies whether to show this mount in
// the UI-specific listing endpoint. Valid values are "unauth" or "hidden".
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
ListingVisibility pulumi.StringOutput `pulumi:"listingVisibility"`
// Specifies if the auth method is local only.
Local pulumi.BoolPtrOutput `pulumi:"local"`
// (Optional; Deprecated, use `tune.max_lease_ttl` if you are using Vault provider version >= 1.8) The maximum lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
MaxLeaseTtlSeconds pulumi.IntOutput `pulumi:"maxLeaseTtlSeconds"`
// The path to mount the auth method — this defaults to the name of the type
Path pulumi.StringOutput `pulumi:"path"`
// Extra configuration block. Structure is documented below.
Tune AuthBackendTuneOutput `pulumi:"tune"`
// The name of the auth method type
Type pulumi.StringOutput `pulumi:"type"`
}
// NewAuthBackend registers a new resource with the given unique name, arguments, and options.
func NewAuthBackend(ctx *pulumi.Context,
name string, args *AuthBackendArgs, opts ...pulumi.ResourceOption) (*AuthBackend, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
var resource AuthBackend
err := ctx.RegisterResource("vault:index/authBackend:AuthBackend", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAuthBackend gets an existing AuthBackend 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 GetAuthBackend(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AuthBackendState, opts ...pulumi.ResourceOption) (*AuthBackend, error) {
var resource AuthBackend
err := ctx.ReadResource("vault:index/authBackend:AuthBackend", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AuthBackend resources.
type authBackendState struct {
// The accessor for this auth method
Accessor *string `pulumi:"accessor"`
// (Optional; Deprecated, use `tune.default_lease_ttl` if you are using Vault provider version >= 1.8) The default lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
DefaultLeaseTtlSeconds *int `pulumi:"defaultLeaseTtlSeconds"`
// A description of the auth method
Description *string `pulumi:"description"`
// Specifies whether to show this mount in
// the UI-specific listing endpoint. Valid values are "unauth" or "hidden".
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
ListingVisibility *string `pulumi:"listingVisibility"`
// Specifies if the auth method is local only.
Local *bool `pulumi:"local"`
// (Optional; Deprecated, use `tune.max_lease_ttl` if you are using Vault provider version >= 1.8) The maximum lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
MaxLeaseTtlSeconds *int `pulumi:"maxLeaseTtlSeconds"`
// The path to mount the auth method — this defaults to the name of the type
Path *string `pulumi:"path"`
// Extra configuration block. Structure is documented below.
Tune *AuthBackendTune `pulumi:"tune"`
// The name of the auth method type
Type *string `pulumi:"type"`
}
type AuthBackendState struct {
// The accessor for this auth method
Accessor pulumi.StringPtrInput
// (Optional; Deprecated, use `tune.default_lease_ttl` if you are using Vault provider version >= 1.8) The default lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
DefaultLeaseTtlSeconds pulumi.IntPtrInput
// A description of the auth method
Description pulumi.StringPtrInput
// Specifies whether to show this mount in
// the UI-specific listing endpoint. Valid values are "unauth" or "hidden".
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
ListingVisibility pulumi.StringPtrInput
// Specifies if the auth method is local only.
Local pulumi.BoolPtrInput
// (Optional; Deprecated, use `tune.max_lease_ttl` if you are using Vault provider version >= 1.8) The maximum lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
MaxLeaseTtlSeconds pulumi.IntPtrInput
// The path to mount the auth method — this defaults to the name of the type
Path pulumi.StringPtrInput
// Extra configuration block. Structure is documented below.
Tune AuthBackendTunePtrInput
// The name of the auth method type
Type pulumi.StringPtrInput
}
func (AuthBackendState) ElementType() reflect.Type {
return reflect.TypeOf((*authBackendState)(nil)).Elem()
}
type authBackendArgs struct {
// (Optional; Deprecated, use `tune.default_lease_ttl` if you are using Vault provider version >= 1.8) The default lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
DefaultLeaseTtlSeconds *int `pulumi:"defaultLeaseTtlSeconds"`
// A description of the auth method
Description *string `pulumi:"description"`
// Specifies whether to show this mount in
// the UI-specific listing endpoint. Valid values are "unauth" or "hidden".
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
ListingVisibility *string `pulumi:"listingVisibility"`
// Specifies if the auth method is local only.
Local *bool `pulumi:"local"`
// (Optional; Deprecated, use `tune.max_lease_ttl` if you are using Vault provider version >= 1.8) The maximum lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
MaxLeaseTtlSeconds *int `pulumi:"maxLeaseTtlSeconds"`
// The path to mount the auth method — this defaults to the name of the type
Path *string `pulumi:"path"`
// Extra configuration block. Structure is documented below.
Tune *AuthBackendTune `pulumi:"tune"`
// The name of the auth method type
Type string `pulumi:"type"`
}
// The set of arguments for constructing a AuthBackend resource.
type AuthBackendArgs struct {
// (Optional; Deprecated, use `tune.default_lease_ttl` if you are using Vault provider version >= 1.8) The default lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
DefaultLeaseTtlSeconds pulumi.IntPtrInput
// A description of the auth method
Description pulumi.StringPtrInput
// Specifies whether to show this mount in
// the UI-specific listing endpoint. Valid values are "unauth" or "hidden".
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
ListingVisibility pulumi.StringPtrInput
// Specifies if the auth method is local only.
Local pulumi.BoolPtrInput
// (Optional; Deprecated, use `tune.max_lease_ttl` if you are using Vault provider version >= 1.8) The maximum lease duration in seconds.
//
// Deprecated: Use the tune configuration block to avoid forcing creation of new resource on an update
MaxLeaseTtlSeconds pulumi.IntPtrInput
// The path to mount the auth method — this defaults to the name of the type
Path pulumi.StringPtrInput
// Extra configuration block. Structure is documented below.
Tune AuthBackendTunePtrInput
// The name of the auth method type
Type pulumi.StringInput
}
func (AuthBackendArgs) ElementType() reflect.Type {
return reflect.TypeOf((*authBackendArgs)(nil)).Elem()
}
type AuthBackendInput interface {
pulumi.Input
ToAuthBackendOutput() AuthBackendOutput
ToAuthBackendOutputWithContext(ctx context.Context) AuthBackendOutput
}
func (*AuthBackend) ElementType() reflect.Type {
return reflect.TypeOf((*AuthBackend)(nil))
}
func (i *AuthBackend) ToAuthBackendOutput() AuthBackendOutput {
return i.ToAuthBackendOutputWithContext(context.Background())
}
func (i *AuthBackend) ToAuthBackendOutputWithContext(ctx context.Context) AuthBackendOutput {
return pulumi.ToOutputWithContext(ctx, i).(AuthBackendOutput)
}
func (i *AuthBackend) ToAuthBackendPtrOutput() AuthBackendPtrOutput {
return i.ToAuthBackendPtrOutputWithContext(context.Background())
}
func (i *AuthBackend) ToAuthBackendPtrOutputWithContext(ctx context.Context) AuthBackendPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AuthBackendPtrOutput)
}
type AuthBackendPtrInput interface {
pulumi.Input
ToAuthBackendPtrOutput() AuthBackendPtrOutput
ToAuthBackendPtrOutputWithContext(ctx context.Context) AuthBackendPtrOutput
}
type authBackendPtrType AuthBackendArgs
func (*authBackendPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**AuthBackend)(nil))
}
func (i *authBackendPtrType) ToAuthBackendPtrOutput() AuthBackendPtrOutput {
return i.ToAuthBackendPtrOutputWithContext(context.Background())
}
func (i *authBackendPtrType) ToAuthBackendPtrOutputWithContext(ctx context.Context) AuthBackendPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AuthBackendPtrOutput)
}
// AuthBackendArrayInput is an input type that accepts AuthBackendArray and AuthBackendArrayOutput values.
// You can construct a concrete instance of `AuthBackendArrayInput` via:
//
// AuthBackendArray{ AuthBackendArgs{...} }
type AuthBackendArrayInput interface {
pulumi.Input
ToAuthBackendArrayOutput() AuthBackendArrayOutput
ToAuthBackendArrayOutputWithContext(context.Context) AuthBackendArrayOutput
}
type AuthBackendArray []AuthBackendInput
func (AuthBackendArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AuthBackend)(nil)).Elem()
}
func (i AuthBackendArray) ToAuthBackendArrayOutput() AuthBackendArrayOutput {
return i.ToAuthBackendArrayOutputWithContext(context.Background())
}
func (i AuthBackendArray) ToAuthBackendArrayOutputWithContext(ctx context.Context) AuthBackendArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AuthBackendArrayOutput)
}
// AuthBackendMapInput is an input type that accepts AuthBackendMap and AuthBackendMapOutput values.
// You can construct a concrete instance of `AuthBackendMapInput` via:
//
// AuthBackendMap{ "key": AuthBackendArgs{...} }
type AuthBackendMapInput interface {
pulumi.Input
ToAuthBackendMapOutput() AuthBackendMapOutput
ToAuthBackendMapOutputWithContext(context.Context) AuthBackendMapOutput
}
type AuthBackendMap map[string]AuthBackendInput
func (AuthBackendMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AuthBackend)(nil)).Elem()
}
func (i AuthBackendMap) ToAuthBackendMapOutput() AuthBackendMapOutput {
return i.ToAuthBackendMapOutputWithContext(context.Background())
}
func (i AuthBackendMap) ToAuthBackendMapOutputWithContext(ctx context.Context) AuthBackendMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AuthBackendMapOutput)
}
type AuthBackendOutput struct{ *pulumi.OutputState }
func (AuthBackendOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AuthBackend)(nil))
}
func (o AuthBackendOutput) ToAuthBackendOutput() AuthBackendOutput {
return o
}
func (o AuthBackendOutput) ToAuthBackendOutputWithContext(ctx context.Context) AuthBackendOutput {
return o
}
func (o AuthBackendOutput) ToAuthBackendPtrOutput() AuthBackendPtrOutput {
return o.ToAuthBackendPtrOutputWithContext(context.Background())
}
func (o AuthBackendOutput) ToAuthBackendPtrOutputWithContext(ctx context.Context) AuthBackendPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v AuthBackend) *AuthBackend {
return &v
}).(AuthBackendPtrOutput)
}
type AuthBackendPtrOutput struct{ *pulumi.OutputState }
func (AuthBackendPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AuthBackend)(nil))
}
func (o AuthBackendPtrOutput) ToAuthBackendPtrOutput() AuthBackendPtrOutput {
return o
}
func (o AuthBackendPtrOutput) ToAuthBackendPtrOutputWithContext(ctx context.Context) AuthBackendPtrOutput {
return o
}
func (o AuthBackendPtrOutput) Elem() AuthBackendOutput {
return o.ApplyT(func(v *AuthBackend) AuthBackend {
if v != nil {
return *v
}
var ret AuthBackend
return ret
}).(AuthBackendOutput)
}
type AuthBackendArrayOutput struct{ *pulumi.OutputState }
func (AuthBackendArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]AuthBackend)(nil))
}
func (o AuthBackendArrayOutput) ToAuthBackendArrayOutput() AuthBackendArrayOutput {
return o
}
func (o AuthBackendArrayOutput) ToAuthBackendArrayOutputWithContext(ctx context.Context) AuthBackendArrayOutput {
return o
}
func (o AuthBackendArrayOutput) Index(i pulumi.IntInput) AuthBackendOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) AuthBackend {
return vs[0].([]AuthBackend)[vs[1].(int)]
}).(AuthBackendOutput)
}
type AuthBackendMapOutput struct{ *pulumi.OutputState }
func (AuthBackendMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]AuthBackend)(nil))
}
func (o AuthBackendMapOutput) ToAuthBackendMapOutput() AuthBackendMapOutput {
return o
}
func (o AuthBackendMapOutput) ToAuthBackendMapOutputWithContext(ctx context.Context) AuthBackendMapOutput {
return o
}
func (o AuthBackendMapOutput) MapIndex(k pulumi.StringInput) AuthBackendOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) AuthBackend {
return vs[0].(map[string]AuthBackend)[vs[1].(string)]
}).(AuthBackendOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AuthBackendInput)(nil)).Elem(), &AuthBackend{})
pulumi.RegisterInputType(reflect.TypeOf((*AuthBackendPtrInput)(nil)).Elem(), &AuthBackend{})
pulumi.RegisterInputType(reflect.TypeOf((*AuthBackendArrayInput)(nil)).Elem(), AuthBackendArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AuthBackendMapInput)(nil)).Elem(), AuthBackendMap{})
pulumi.RegisterOutputType(AuthBackendOutput{})
pulumi.RegisterOutputType(AuthBackendPtrOutput{})
pulumi.RegisterOutputType(AuthBackendArrayOutput{})
pulumi.RegisterOutputType(AuthBackendMapOutput{})
}