/
tenantOauthIdpConfig.go
452 lines (392 loc) · 16.8 KB
/
tenantOauthIdpConfig.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
// 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 identityplatform
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// OIDC IdP configuration for a Identity Toolkit project within a tenant.
//
// You must enable the
// [Google Identity Platform](https://console.cloud.google.com/marketplace/details/google-cloud-platform/customer-identity) in
// the marketplace prior to using this resource.
//
// ## Example Usage
// ### Identity Platform Tenant Oauth Idp Config Basic
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/identityplatform"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// tenant, err := identityplatform.NewTenant(ctx, "tenant", &identityplatform.TenantArgs{
// DisplayName: pulumi.String("tenant"),
// })
// if err != nil {
// return err
// }
// _, err = identityplatform.NewTenantOauthIdpConfig(ctx, "tenantOauthIdpConfig", &identityplatform.TenantOauthIdpConfigArgs{
// Tenant: tenant.Name,
// DisplayName: pulumi.String("Display Name"),
// ClientId: pulumi.String("client-id"),
// Issuer: pulumi.String("issuer"),
// Enabled: pulumi.Bool(true),
// ClientSecret: pulumi.String("secret"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// # TenantOauthIdpConfig can be imported using any of these accepted formats
//
// ```sh
//
// $ pulumi import gcp:identityplatform/tenantOauthIdpConfig:TenantOauthIdpConfig default projects/{{project}}/tenants/{{tenant}}/oauthIdpConfigs/{{name}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:identityplatform/tenantOauthIdpConfig:TenantOauthIdpConfig default {{project}}/{{tenant}}/{{name}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:identityplatform/tenantOauthIdpConfig:TenantOauthIdpConfig default {{tenant}}/{{name}}
//
// ```
type TenantOauthIdpConfig struct {
pulumi.CustomResourceState
// The client id of an OAuth client.
//
// ***
ClientId pulumi.StringOutput `pulumi:"clientId"`
// The client secret of the OAuth client, to enable OIDC code flow.
ClientSecret pulumi.StringPtrOutput `pulumi:"clientSecret"`
// Human friendly display name.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// If this config allows users to sign in with the provider.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// For OIDC Idps, the issuer identifier.
Issuer pulumi.StringOutput `pulumi:"issuer"`
// The name of the OauthIdpConfig. Must start with `oidc.`.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringOutput `pulumi:"project"`
// The name of the tenant where this OIDC IDP configuration resource exists
Tenant pulumi.StringOutput `pulumi:"tenant"`
}
// NewTenantOauthIdpConfig registers a new resource with the given unique name, arguments, and options.
func NewTenantOauthIdpConfig(ctx *pulumi.Context,
name string, args *TenantOauthIdpConfigArgs, opts ...pulumi.ResourceOption) (*TenantOauthIdpConfig, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClientId == nil {
return nil, errors.New("invalid value for required argument 'ClientId'")
}
if args.DisplayName == nil {
return nil, errors.New("invalid value for required argument 'DisplayName'")
}
if args.Issuer == nil {
return nil, errors.New("invalid value for required argument 'Issuer'")
}
if args.Tenant == nil {
return nil, errors.New("invalid value for required argument 'Tenant'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource TenantOauthIdpConfig
err := ctx.RegisterResource("gcp:identityplatform/tenantOauthIdpConfig:TenantOauthIdpConfig", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTenantOauthIdpConfig gets an existing TenantOauthIdpConfig 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 GetTenantOauthIdpConfig(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TenantOauthIdpConfigState, opts ...pulumi.ResourceOption) (*TenantOauthIdpConfig, error) {
var resource TenantOauthIdpConfig
err := ctx.ReadResource("gcp:identityplatform/tenantOauthIdpConfig:TenantOauthIdpConfig", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering TenantOauthIdpConfig resources.
type tenantOauthIdpConfigState struct {
// The client id of an OAuth client.
//
// ***
ClientId *string `pulumi:"clientId"`
// The client secret of the OAuth client, to enable OIDC code flow.
ClientSecret *string `pulumi:"clientSecret"`
// Human friendly display name.
DisplayName *string `pulumi:"displayName"`
// If this config allows users to sign in with the provider.
Enabled *bool `pulumi:"enabled"`
// For OIDC Idps, the issuer identifier.
Issuer *string `pulumi:"issuer"`
// The name of the OauthIdpConfig. Must start with `oidc.`.
Name *string `pulumi:"name"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// The name of the tenant where this OIDC IDP configuration resource exists
Tenant *string `pulumi:"tenant"`
}
type TenantOauthIdpConfigState struct {
// The client id of an OAuth client.
//
// ***
ClientId pulumi.StringPtrInput
// The client secret of the OAuth client, to enable OIDC code flow.
ClientSecret pulumi.StringPtrInput
// Human friendly display name.
DisplayName pulumi.StringPtrInput
// If this config allows users to sign in with the provider.
Enabled pulumi.BoolPtrInput
// For OIDC Idps, the issuer identifier.
Issuer pulumi.StringPtrInput
// The name of the OauthIdpConfig. Must start with `oidc.`.
Name pulumi.StringPtrInput
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput
// The name of the tenant where this OIDC IDP configuration resource exists
Tenant pulumi.StringPtrInput
}
func (TenantOauthIdpConfigState) ElementType() reflect.Type {
return reflect.TypeOf((*tenantOauthIdpConfigState)(nil)).Elem()
}
type tenantOauthIdpConfigArgs struct {
// The client id of an OAuth client.
//
// ***
ClientId string `pulumi:"clientId"`
// The client secret of the OAuth client, to enable OIDC code flow.
ClientSecret *string `pulumi:"clientSecret"`
// Human friendly display name.
DisplayName string `pulumi:"displayName"`
// If this config allows users to sign in with the provider.
Enabled *bool `pulumi:"enabled"`
// For OIDC Idps, the issuer identifier.
Issuer string `pulumi:"issuer"`
// The name of the OauthIdpConfig. Must start with `oidc.`.
Name *string `pulumi:"name"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// The name of the tenant where this OIDC IDP configuration resource exists
Tenant string `pulumi:"tenant"`
}
// The set of arguments for constructing a TenantOauthIdpConfig resource.
type TenantOauthIdpConfigArgs struct {
// The client id of an OAuth client.
//
// ***
ClientId pulumi.StringInput
// The client secret of the OAuth client, to enable OIDC code flow.
ClientSecret pulumi.StringPtrInput
// Human friendly display name.
DisplayName pulumi.StringInput
// If this config allows users to sign in with the provider.
Enabled pulumi.BoolPtrInput
// For OIDC Idps, the issuer identifier.
Issuer pulumi.StringInput
// The name of the OauthIdpConfig. Must start with `oidc.`.
Name pulumi.StringPtrInput
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput
// The name of the tenant where this OIDC IDP configuration resource exists
Tenant pulumi.StringInput
}
func (TenantOauthIdpConfigArgs) ElementType() reflect.Type {
return reflect.TypeOf((*tenantOauthIdpConfigArgs)(nil)).Elem()
}
type TenantOauthIdpConfigInput interface {
pulumi.Input
ToTenantOauthIdpConfigOutput() TenantOauthIdpConfigOutput
ToTenantOauthIdpConfigOutputWithContext(ctx context.Context) TenantOauthIdpConfigOutput
}
func (*TenantOauthIdpConfig) ElementType() reflect.Type {
return reflect.TypeOf((**TenantOauthIdpConfig)(nil)).Elem()
}
func (i *TenantOauthIdpConfig) ToTenantOauthIdpConfigOutput() TenantOauthIdpConfigOutput {
return i.ToTenantOauthIdpConfigOutputWithContext(context.Background())
}
func (i *TenantOauthIdpConfig) ToTenantOauthIdpConfigOutputWithContext(ctx context.Context) TenantOauthIdpConfigOutput {
return pulumi.ToOutputWithContext(ctx, i).(TenantOauthIdpConfigOutput)
}
func (i *TenantOauthIdpConfig) ToOutput(ctx context.Context) pulumix.Output[*TenantOauthIdpConfig] {
return pulumix.Output[*TenantOauthIdpConfig]{
OutputState: i.ToTenantOauthIdpConfigOutputWithContext(ctx).OutputState,
}
}
// TenantOauthIdpConfigArrayInput is an input type that accepts TenantOauthIdpConfigArray and TenantOauthIdpConfigArrayOutput values.
// You can construct a concrete instance of `TenantOauthIdpConfigArrayInput` via:
//
// TenantOauthIdpConfigArray{ TenantOauthIdpConfigArgs{...} }
type TenantOauthIdpConfigArrayInput interface {
pulumi.Input
ToTenantOauthIdpConfigArrayOutput() TenantOauthIdpConfigArrayOutput
ToTenantOauthIdpConfigArrayOutputWithContext(context.Context) TenantOauthIdpConfigArrayOutput
}
type TenantOauthIdpConfigArray []TenantOauthIdpConfigInput
func (TenantOauthIdpConfigArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TenantOauthIdpConfig)(nil)).Elem()
}
func (i TenantOauthIdpConfigArray) ToTenantOauthIdpConfigArrayOutput() TenantOauthIdpConfigArrayOutput {
return i.ToTenantOauthIdpConfigArrayOutputWithContext(context.Background())
}
func (i TenantOauthIdpConfigArray) ToTenantOauthIdpConfigArrayOutputWithContext(ctx context.Context) TenantOauthIdpConfigArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TenantOauthIdpConfigArrayOutput)
}
func (i TenantOauthIdpConfigArray) ToOutput(ctx context.Context) pulumix.Output[[]*TenantOauthIdpConfig] {
return pulumix.Output[[]*TenantOauthIdpConfig]{
OutputState: i.ToTenantOauthIdpConfigArrayOutputWithContext(ctx).OutputState,
}
}
// TenantOauthIdpConfigMapInput is an input type that accepts TenantOauthIdpConfigMap and TenantOauthIdpConfigMapOutput values.
// You can construct a concrete instance of `TenantOauthIdpConfigMapInput` via:
//
// TenantOauthIdpConfigMap{ "key": TenantOauthIdpConfigArgs{...} }
type TenantOauthIdpConfigMapInput interface {
pulumi.Input
ToTenantOauthIdpConfigMapOutput() TenantOauthIdpConfigMapOutput
ToTenantOauthIdpConfigMapOutputWithContext(context.Context) TenantOauthIdpConfigMapOutput
}
type TenantOauthIdpConfigMap map[string]TenantOauthIdpConfigInput
func (TenantOauthIdpConfigMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TenantOauthIdpConfig)(nil)).Elem()
}
func (i TenantOauthIdpConfigMap) ToTenantOauthIdpConfigMapOutput() TenantOauthIdpConfigMapOutput {
return i.ToTenantOauthIdpConfigMapOutputWithContext(context.Background())
}
func (i TenantOauthIdpConfigMap) ToTenantOauthIdpConfigMapOutputWithContext(ctx context.Context) TenantOauthIdpConfigMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TenantOauthIdpConfigMapOutput)
}
func (i TenantOauthIdpConfigMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*TenantOauthIdpConfig] {
return pulumix.Output[map[string]*TenantOauthIdpConfig]{
OutputState: i.ToTenantOauthIdpConfigMapOutputWithContext(ctx).OutputState,
}
}
type TenantOauthIdpConfigOutput struct{ *pulumi.OutputState }
func (TenantOauthIdpConfigOutput) ElementType() reflect.Type {
return reflect.TypeOf((**TenantOauthIdpConfig)(nil)).Elem()
}
func (o TenantOauthIdpConfigOutput) ToTenantOauthIdpConfigOutput() TenantOauthIdpConfigOutput {
return o
}
func (o TenantOauthIdpConfigOutput) ToTenantOauthIdpConfigOutputWithContext(ctx context.Context) TenantOauthIdpConfigOutput {
return o
}
func (o TenantOauthIdpConfigOutput) ToOutput(ctx context.Context) pulumix.Output[*TenantOauthIdpConfig] {
return pulumix.Output[*TenantOauthIdpConfig]{
OutputState: o.OutputState,
}
}
// The client id of an OAuth client.
//
// ***
func (o TenantOauthIdpConfigOutput) ClientId() pulumi.StringOutput {
return o.ApplyT(func(v *TenantOauthIdpConfig) pulumi.StringOutput { return v.ClientId }).(pulumi.StringOutput)
}
// The client secret of the OAuth client, to enable OIDC code flow.
func (o TenantOauthIdpConfigOutput) ClientSecret() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TenantOauthIdpConfig) pulumi.StringPtrOutput { return v.ClientSecret }).(pulumi.StringPtrOutput)
}
// Human friendly display name.
func (o TenantOauthIdpConfigOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *TenantOauthIdpConfig) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// If this config allows users to sign in with the provider.
func (o TenantOauthIdpConfigOutput) Enabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *TenantOauthIdpConfig) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
}
// For OIDC Idps, the issuer identifier.
func (o TenantOauthIdpConfigOutput) Issuer() pulumi.StringOutput {
return o.ApplyT(func(v *TenantOauthIdpConfig) pulumi.StringOutput { return v.Issuer }).(pulumi.StringOutput)
}
// The name of the OauthIdpConfig. Must start with `oidc.`.
func (o TenantOauthIdpConfigOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *TenantOauthIdpConfig) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
func (o TenantOauthIdpConfigOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *TenantOauthIdpConfig) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// The name of the tenant where this OIDC IDP configuration resource exists
func (o TenantOauthIdpConfigOutput) Tenant() pulumi.StringOutput {
return o.ApplyT(func(v *TenantOauthIdpConfig) pulumi.StringOutput { return v.Tenant }).(pulumi.StringOutput)
}
type TenantOauthIdpConfigArrayOutput struct{ *pulumi.OutputState }
func (TenantOauthIdpConfigArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TenantOauthIdpConfig)(nil)).Elem()
}
func (o TenantOauthIdpConfigArrayOutput) ToTenantOauthIdpConfigArrayOutput() TenantOauthIdpConfigArrayOutput {
return o
}
func (o TenantOauthIdpConfigArrayOutput) ToTenantOauthIdpConfigArrayOutputWithContext(ctx context.Context) TenantOauthIdpConfigArrayOutput {
return o
}
func (o TenantOauthIdpConfigArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*TenantOauthIdpConfig] {
return pulumix.Output[[]*TenantOauthIdpConfig]{
OutputState: o.OutputState,
}
}
func (o TenantOauthIdpConfigArrayOutput) Index(i pulumi.IntInput) TenantOauthIdpConfigOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TenantOauthIdpConfig {
return vs[0].([]*TenantOauthIdpConfig)[vs[1].(int)]
}).(TenantOauthIdpConfigOutput)
}
type TenantOauthIdpConfigMapOutput struct{ *pulumi.OutputState }
func (TenantOauthIdpConfigMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TenantOauthIdpConfig)(nil)).Elem()
}
func (o TenantOauthIdpConfigMapOutput) ToTenantOauthIdpConfigMapOutput() TenantOauthIdpConfigMapOutput {
return o
}
func (o TenantOauthIdpConfigMapOutput) ToTenantOauthIdpConfigMapOutputWithContext(ctx context.Context) TenantOauthIdpConfigMapOutput {
return o
}
func (o TenantOauthIdpConfigMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*TenantOauthIdpConfig] {
return pulumix.Output[map[string]*TenantOauthIdpConfig]{
OutputState: o.OutputState,
}
}
func (o TenantOauthIdpConfigMapOutput) MapIndex(k pulumi.StringInput) TenantOauthIdpConfigOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TenantOauthIdpConfig {
return vs[0].(map[string]*TenantOauthIdpConfig)[vs[1].(string)]
}).(TenantOauthIdpConfigOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TenantOauthIdpConfigInput)(nil)).Elem(), &TenantOauthIdpConfig{})
pulumi.RegisterInputType(reflect.TypeOf((*TenantOauthIdpConfigArrayInput)(nil)).Elem(), TenantOauthIdpConfigArray{})
pulumi.RegisterInputType(reflect.TypeOf((*TenantOauthIdpConfigMapInput)(nil)).Elem(), TenantOauthIdpConfigMap{})
pulumi.RegisterOutputType(TenantOauthIdpConfigOutput{})
pulumi.RegisterOutputType(TenantOauthIdpConfigArrayOutput{})
pulumi.RegisterOutputType(TenantOauthIdpConfigMapOutput{})
}