/
inboundSamlConfig.go
450 lines (392 loc) · 17.8 KB
/
inboundSamlConfig.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
// 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"
)
// Inbound SAML configuration for a Identity Toolkit project.
//
// 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 Inbound Saml Config Basic
//
// ```go
// package main
//
// import (
//
// "os"
//
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/identityplatform"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func readFileOrPanic(path string) pulumi.StringPtrInput {
// data, err := os.ReadFile(path)
// if err != nil {
// panic(err.Error())
// }
// return pulumi.String(string(data))
// }
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := identityplatform.NewInboundSamlConfig(ctx, "samlConfig", &identityplatform.InboundSamlConfigArgs{
// DisplayName: pulumi.String("Display Name"),
// IdpConfig: &identityplatform.InboundSamlConfigIdpConfigArgs{
// IdpEntityId: pulumi.String("tf-idp"),
// SignRequest: pulumi.Bool(true),
// SsoUrl: pulumi.String("https://example.com"),
// IdpCertificates: identityplatform.InboundSamlConfigIdpConfigIdpCertificateArray{
// &identityplatform.InboundSamlConfigIdpConfigIdpCertificateArgs{
// X509Certificate: readFileOrPanic("test-fixtures/rsa_cert.pem"),
// },
// },
// },
// SpConfig: &identityplatform.InboundSamlConfigSpConfigArgs{
// SpEntityId: pulumi.String("tf-sp"),
// CallbackUri: pulumi.String("https://example.com"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// # InboundSamlConfig can be imported using any of these accepted formats
//
// ```sh
//
// $ pulumi import gcp:identityplatform/inboundSamlConfig:InboundSamlConfig default projects/{{project}}/inboundSamlConfigs/{{name}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:identityplatform/inboundSamlConfig:InboundSamlConfig default {{project}}/{{name}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:identityplatform/inboundSamlConfig:InboundSamlConfig default {{name}}
//
// ```
type InboundSamlConfig struct {
pulumi.CustomResourceState
// 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"`
// SAML IdP configuration when the project acts as the relying party
// Structure is documented below.
IdpConfig InboundSamlConfigIdpConfigOutput `pulumi:"idpConfig"`
// The name of the InboundSamlConfig resource. Must start with 'saml.' and can only have alphanumeric characters,
// hyphens, underscores or periods. The part after 'saml.' must also start with a lowercase letter, end with an
// alphanumeric character, and have at least 2 characters.
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"`
// SAML SP (Service Provider) configuration when the project acts as the relying party to receive
// and accept an authentication assertion issued by a SAML identity provider.
// Structure is documented below.
SpConfig InboundSamlConfigSpConfigOutput `pulumi:"spConfig"`
}
// NewInboundSamlConfig registers a new resource with the given unique name, arguments, and options.
func NewInboundSamlConfig(ctx *pulumi.Context,
name string, args *InboundSamlConfigArgs, opts ...pulumi.ResourceOption) (*InboundSamlConfig, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DisplayName == nil {
return nil, errors.New("invalid value for required argument 'DisplayName'")
}
if args.IdpConfig == nil {
return nil, errors.New("invalid value for required argument 'IdpConfig'")
}
if args.SpConfig == nil {
return nil, errors.New("invalid value for required argument 'SpConfig'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource InboundSamlConfig
err := ctx.RegisterResource("gcp:identityplatform/inboundSamlConfig:InboundSamlConfig", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInboundSamlConfig gets an existing InboundSamlConfig 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 GetInboundSamlConfig(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InboundSamlConfigState, opts ...pulumi.ResourceOption) (*InboundSamlConfig, error) {
var resource InboundSamlConfig
err := ctx.ReadResource("gcp:identityplatform/inboundSamlConfig:InboundSamlConfig", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering InboundSamlConfig resources.
type inboundSamlConfigState struct {
// Human friendly display name.
DisplayName *string `pulumi:"displayName"`
// If this config allows users to sign in with the provider.
Enabled *bool `pulumi:"enabled"`
// SAML IdP configuration when the project acts as the relying party
// Structure is documented below.
IdpConfig *InboundSamlConfigIdpConfig `pulumi:"idpConfig"`
// The name of the InboundSamlConfig resource. Must start with 'saml.' and can only have alphanumeric characters,
// hyphens, underscores or periods. The part after 'saml.' must also start with a lowercase letter, end with an
// alphanumeric character, and have at least 2 characters.
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"`
// SAML SP (Service Provider) configuration when the project acts as the relying party to receive
// and accept an authentication assertion issued by a SAML identity provider.
// Structure is documented below.
SpConfig *InboundSamlConfigSpConfig `pulumi:"spConfig"`
}
type InboundSamlConfigState struct {
// Human friendly display name.
DisplayName pulumi.StringPtrInput
// If this config allows users to sign in with the provider.
Enabled pulumi.BoolPtrInput
// SAML IdP configuration when the project acts as the relying party
// Structure is documented below.
IdpConfig InboundSamlConfigIdpConfigPtrInput
// The name of the InboundSamlConfig resource. Must start with 'saml.' and can only have alphanumeric characters,
// hyphens, underscores or periods. The part after 'saml.' must also start with a lowercase letter, end with an
// alphanumeric character, and have at least 2 characters.
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
// SAML SP (Service Provider) configuration when the project acts as the relying party to receive
// and accept an authentication assertion issued by a SAML identity provider.
// Structure is documented below.
SpConfig InboundSamlConfigSpConfigPtrInput
}
func (InboundSamlConfigState) ElementType() reflect.Type {
return reflect.TypeOf((*inboundSamlConfigState)(nil)).Elem()
}
type inboundSamlConfigArgs struct {
// Human friendly display name.
DisplayName string `pulumi:"displayName"`
// If this config allows users to sign in with the provider.
Enabled *bool `pulumi:"enabled"`
// SAML IdP configuration when the project acts as the relying party
// Structure is documented below.
IdpConfig InboundSamlConfigIdpConfig `pulumi:"idpConfig"`
// The name of the InboundSamlConfig resource. Must start with 'saml.' and can only have alphanumeric characters,
// hyphens, underscores or periods. The part after 'saml.' must also start with a lowercase letter, end with an
// alphanumeric character, and have at least 2 characters.
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"`
// SAML SP (Service Provider) configuration when the project acts as the relying party to receive
// and accept an authentication assertion issued by a SAML identity provider.
// Structure is documented below.
SpConfig InboundSamlConfigSpConfig `pulumi:"spConfig"`
}
// The set of arguments for constructing a InboundSamlConfig resource.
type InboundSamlConfigArgs struct {
// Human friendly display name.
DisplayName pulumi.StringInput
// If this config allows users to sign in with the provider.
Enabled pulumi.BoolPtrInput
// SAML IdP configuration when the project acts as the relying party
// Structure is documented below.
IdpConfig InboundSamlConfigIdpConfigInput
// The name of the InboundSamlConfig resource. Must start with 'saml.' and can only have alphanumeric characters,
// hyphens, underscores or periods. The part after 'saml.' must also start with a lowercase letter, end with an
// alphanumeric character, and have at least 2 characters.
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
// SAML SP (Service Provider) configuration when the project acts as the relying party to receive
// and accept an authentication assertion issued by a SAML identity provider.
// Structure is documented below.
SpConfig InboundSamlConfigSpConfigInput
}
func (InboundSamlConfigArgs) ElementType() reflect.Type {
return reflect.TypeOf((*inboundSamlConfigArgs)(nil)).Elem()
}
type InboundSamlConfigInput interface {
pulumi.Input
ToInboundSamlConfigOutput() InboundSamlConfigOutput
ToInboundSamlConfigOutputWithContext(ctx context.Context) InboundSamlConfigOutput
}
func (*InboundSamlConfig) ElementType() reflect.Type {
return reflect.TypeOf((**InboundSamlConfig)(nil)).Elem()
}
func (i *InboundSamlConfig) ToInboundSamlConfigOutput() InboundSamlConfigOutput {
return i.ToInboundSamlConfigOutputWithContext(context.Background())
}
func (i *InboundSamlConfig) ToInboundSamlConfigOutputWithContext(ctx context.Context) InboundSamlConfigOutput {
return pulumi.ToOutputWithContext(ctx, i).(InboundSamlConfigOutput)
}
func (i *InboundSamlConfig) ToOutput(ctx context.Context) pulumix.Output[*InboundSamlConfig] {
return pulumix.Output[*InboundSamlConfig]{
OutputState: i.ToInboundSamlConfigOutputWithContext(ctx).OutputState,
}
}
// InboundSamlConfigArrayInput is an input type that accepts InboundSamlConfigArray and InboundSamlConfigArrayOutput values.
// You can construct a concrete instance of `InboundSamlConfigArrayInput` via:
//
// InboundSamlConfigArray{ InboundSamlConfigArgs{...} }
type InboundSamlConfigArrayInput interface {
pulumi.Input
ToInboundSamlConfigArrayOutput() InboundSamlConfigArrayOutput
ToInboundSamlConfigArrayOutputWithContext(context.Context) InboundSamlConfigArrayOutput
}
type InboundSamlConfigArray []InboundSamlConfigInput
func (InboundSamlConfigArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*InboundSamlConfig)(nil)).Elem()
}
func (i InboundSamlConfigArray) ToInboundSamlConfigArrayOutput() InboundSamlConfigArrayOutput {
return i.ToInboundSamlConfigArrayOutputWithContext(context.Background())
}
func (i InboundSamlConfigArray) ToInboundSamlConfigArrayOutputWithContext(ctx context.Context) InboundSamlConfigArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(InboundSamlConfigArrayOutput)
}
func (i InboundSamlConfigArray) ToOutput(ctx context.Context) pulumix.Output[[]*InboundSamlConfig] {
return pulumix.Output[[]*InboundSamlConfig]{
OutputState: i.ToInboundSamlConfigArrayOutputWithContext(ctx).OutputState,
}
}
// InboundSamlConfigMapInput is an input type that accepts InboundSamlConfigMap and InboundSamlConfigMapOutput values.
// You can construct a concrete instance of `InboundSamlConfigMapInput` via:
//
// InboundSamlConfigMap{ "key": InboundSamlConfigArgs{...} }
type InboundSamlConfigMapInput interface {
pulumi.Input
ToInboundSamlConfigMapOutput() InboundSamlConfigMapOutput
ToInboundSamlConfigMapOutputWithContext(context.Context) InboundSamlConfigMapOutput
}
type InboundSamlConfigMap map[string]InboundSamlConfigInput
func (InboundSamlConfigMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*InboundSamlConfig)(nil)).Elem()
}
func (i InboundSamlConfigMap) ToInboundSamlConfigMapOutput() InboundSamlConfigMapOutput {
return i.ToInboundSamlConfigMapOutputWithContext(context.Background())
}
func (i InboundSamlConfigMap) ToInboundSamlConfigMapOutputWithContext(ctx context.Context) InboundSamlConfigMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(InboundSamlConfigMapOutput)
}
func (i InboundSamlConfigMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*InboundSamlConfig] {
return pulumix.Output[map[string]*InboundSamlConfig]{
OutputState: i.ToInboundSamlConfigMapOutputWithContext(ctx).OutputState,
}
}
type InboundSamlConfigOutput struct{ *pulumi.OutputState }
func (InboundSamlConfigOutput) ElementType() reflect.Type {
return reflect.TypeOf((**InboundSamlConfig)(nil)).Elem()
}
func (o InboundSamlConfigOutput) ToInboundSamlConfigOutput() InboundSamlConfigOutput {
return o
}
func (o InboundSamlConfigOutput) ToInboundSamlConfigOutputWithContext(ctx context.Context) InboundSamlConfigOutput {
return o
}
func (o InboundSamlConfigOutput) ToOutput(ctx context.Context) pulumix.Output[*InboundSamlConfig] {
return pulumix.Output[*InboundSamlConfig]{
OutputState: o.OutputState,
}
}
// Human friendly display name.
func (o InboundSamlConfigOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *InboundSamlConfig) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// If this config allows users to sign in with the provider.
func (o InboundSamlConfigOutput) Enabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *InboundSamlConfig) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
}
// SAML IdP configuration when the project acts as the relying party
// Structure is documented below.
func (o InboundSamlConfigOutput) IdpConfig() InboundSamlConfigIdpConfigOutput {
return o.ApplyT(func(v *InboundSamlConfig) InboundSamlConfigIdpConfigOutput { return v.IdpConfig }).(InboundSamlConfigIdpConfigOutput)
}
// The name of the InboundSamlConfig resource. Must start with 'saml.' and can only have alphanumeric characters,
// hyphens, underscores or periods. The part after 'saml.' must also start with a lowercase letter, end with an
// alphanumeric character, and have at least 2 characters.
func (o InboundSamlConfigOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *InboundSamlConfig) 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 InboundSamlConfigOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *InboundSamlConfig) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// SAML SP (Service Provider) configuration when the project acts as the relying party to receive
// and accept an authentication assertion issued by a SAML identity provider.
// Structure is documented below.
func (o InboundSamlConfigOutput) SpConfig() InboundSamlConfigSpConfigOutput {
return o.ApplyT(func(v *InboundSamlConfig) InboundSamlConfigSpConfigOutput { return v.SpConfig }).(InboundSamlConfigSpConfigOutput)
}
type InboundSamlConfigArrayOutput struct{ *pulumi.OutputState }
func (InboundSamlConfigArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*InboundSamlConfig)(nil)).Elem()
}
func (o InboundSamlConfigArrayOutput) ToInboundSamlConfigArrayOutput() InboundSamlConfigArrayOutput {
return o
}
func (o InboundSamlConfigArrayOutput) ToInboundSamlConfigArrayOutputWithContext(ctx context.Context) InboundSamlConfigArrayOutput {
return o
}
func (o InboundSamlConfigArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*InboundSamlConfig] {
return pulumix.Output[[]*InboundSamlConfig]{
OutputState: o.OutputState,
}
}
func (o InboundSamlConfigArrayOutput) Index(i pulumi.IntInput) InboundSamlConfigOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *InboundSamlConfig {
return vs[0].([]*InboundSamlConfig)[vs[1].(int)]
}).(InboundSamlConfigOutput)
}
type InboundSamlConfigMapOutput struct{ *pulumi.OutputState }
func (InboundSamlConfigMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*InboundSamlConfig)(nil)).Elem()
}
func (o InboundSamlConfigMapOutput) ToInboundSamlConfigMapOutput() InboundSamlConfigMapOutput {
return o
}
func (o InboundSamlConfigMapOutput) ToInboundSamlConfigMapOutputWithContext(ctx context.Context) InboundSamlConfigMapOutput {
return o
}
func (o InboundSamlConfigMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*InboundSamlConfig] {
return pulumix.Output[map[string]*InboundSamlConfig]{
OutputState: o.OutputState,
}
}
func (o InboundSamlConfigMapOutput) MapIndex(k pulumi.StringInput) InboundSamlConfigOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *InboundSamlConfig {
return vs[0].(map[string]*InboundSamlConfig)[vs[1].(string)]
}).(InboundSamlConfigOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*InboundSamlConfigInput)(nil)).Elem(), &InboundSamlConfig{})
pulumi.RegisterInputType(reflect.TypeOf((*InboundSamlConfigArrayInput)(nil)).Elem(), InboundSamlConfigArray{})
pulumi.RegisterInputType(reflect.TypeOf((*InboundSamlConfigMapInput)(nil)).Elem(), InboundSamlConfigMap{})
pulumi.RegisterOutputType(InboundSamlConfigOutput{})
pulumi.RegisterOutputType(InboundSamlConfigArrayOutput{})
pulumi.RegisterOutputType(InboundSamlConfigMapOutput{})
}