/
topic.go
625 lines (566 loc) · 21.5 KB
/
topic.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
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
// 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 pubsub
import (
"context"
"reflect"
"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"
)
// A named resource to which messages are sent by publishers.
//
// To get more information about Topic, see:
//
// * [API documentation](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics)
// * How-to Guides
// - [Managing Topics](https://cloud.google.com/pubsub/docs/admin#managing_topics)
//
// > **Note:** You can retrieve the email of the Google Managed Pub/Sub Service Account used for forwarding
// by using the `projects.ServiceIdentity` resource.
//
// ## Example Usage
// ### Pubsub Topic Basic
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/pubsub"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
// Labels: pulumi.StringMap{
// "foo": pulumi.String("bar"),
// },
// MessageRetentionDuration: pulumi.String("86600s"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Pubsub Topic Cmek
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/kms"
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/pubsub"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// keyRing, err := kms.NewKeyRing(ctx, "keyRing", &kms.KeyRingArgs{
// Location: pulumi.String("global"),
// })
// if err != nil {
// return err
// }
// cryptoKey, err := kms.NewCryptoKey(ctx, "cryptoKey", &kms.CryptoKeyArgs{
// KeyRing: keyRing.ID(),
// })
// if err != nil {
// return err
// }
// _, err = pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
// KmsKeyName: cryptoKey.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Pubsub Topic Geo Restricted
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/pubsub"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
// MessageStoragePolicy: &pubsub.TopicMessageStoragePolicyArgs{
// AllowedPersistenceRegions: pulumi.StringArray{
// pulumi.String("europe-west3"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Pubsub Topic Schema Settings
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/pubsub"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleSchema, err := pubsub.NewSchema(ctx, "exampleSchema", &pubsub.SchemaArgs{
// Type: pulumi.String("AVRO"),
// Definition: pulumi.String(`{
// "type" : "record",
// "name" : "Avro",
// "fields" : [
// {
// "name" : "StringField",
// "type" : "string"
// },
// {
// "name" : "IntField",
// "type" : "int"
// }
// ]
// }
//
// `),
//
// })
// if err != nil {
// return err
// }
// _, err = pubsub.NewTopic(ctx, "exampleTopic", &pubsub.TopicArgs{
// SchemaSettings: &pubsub.TopicSchemaSettingsArgs{
// Schema: pulumi.String("projects/my-project-name/schemas/example"),
// Encoding: pulumi.String("JSON"),
// },
// }, pulumi.DependsOn([]pulumi.Resource{
// exampleSchema,
// }))
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// # Topic can be imported using any of these accepted formats
//
// ```sh
//
// $ pulumi import gcp:pubsub/topic:Topic default projects/{{project}}/topics/{{name}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:pubsub/topic:Topic default {{project}}/{{name}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:pubsub/topic:Topic default {{name}}
//
// ```
type Topic struct {
pulumi.CustomResourceState
// The resource name of the Cloud KMS CryptoKey to be used to protect access
// to messages published on this topic. Your project's PubSub service account
// (`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have
// `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`
KmsKeyName pulumi.StringPtrOutput `pulumi:"kmsKeyName"`
// A set of key/value label pairs to assign to this Topic.
Labels pulumi.StringMapOutput `pulumi:"labels"`
// Indicates the minimum duration to retain a message after it is published
// to the topic. If this field is set, messages published to the topic in
// the last messageRetentionDuration are always available to subscribers.
// For instance, it allows any attached subscription to seek to a timestamp
// that is up to messageRetentionDuration in the past. If this field is not
// set, message retention is controlled by settings on individual subscriptions.
// Cannot be more than 31 days or less than 10 minutes.
MessageRetentionDuration pulumi.StringPtrOutput `pulumi:"messageRetentionDuration"`
// Policy constraining the set of Google Cloud Platform regions where
// messages published to the topic may be stored. If not present, then no
// constraints are in effect.
// Structure is documented below.
MessageStoragePolicy TopicMessageStoragePolicyOutput `pulumi:"messageStoragePolicy"`
// Name of the topic.
//
// ***
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"`
// Settings for validating messages published against a schema.
// Structure is documented below.
SchemaSettings TopicSchemaSettingsOutput `pulumi:"schemaSettings"`
}
// NewTopic registers a new resource with the given unique name, arguments, and options.
func NewTopic(ctx *pulumi.Context,
name string, args *TopicArgs, opts ...pulumi.ResourceOption) (*Topic, error) {
if args == nil {
args = &TopicArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Topic
err := ctx.RegisterResource("gcp:pubsub/topic:Topic", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTopic gets an existing Topic 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 GetTopic(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TopicState, opts ...pulumi.ResourceOption) (*Topic, error) {
var resource Topic
err := ctx.ReadResource("gcp:pubsub/topic:Topic", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Topic resources.
type topicState struct {
// The resource name of the Cloud KMS CryptoKey to be used to protect access
// to messages published on this topic. Your project's PubSub service account
// (`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have
// `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`
KmsKeyName *string `pulumi:"kmsKeyName"`
// A set of key/value label pairs to assign to this Topic.
Labels map[string]string `pulumi:"labels"`
// Indicates the minimum duration to retain a message after it is published
// to the topic. If this field is set, messages published to the topic in
// the last messageRetentionDuration are always available to subscribers.
// For instance, it allows any attached subscription to seek to a timestamp
// that is up to messageRetentionDuration in the past. If this field is not
// set, message retention is controlled by settings on individual subscriptions.
// Cannot be more than 31 days or less than 10 minutes.
MessageRetentionDuration *string `pulumi:"messageRetentionDuration"`
// Policy constraining the set of Google Cloud Platform regions where
// messages published to the topic may be stored. If not present, then no
// constraints are in effect.
// Structure is documented below.
MessageStoragePolicy *TopicMessageStoragePolicy `pulumi:"messageStoragePolicy"`
// Name of the topic.
//
// ***
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"`
// Settings for validating messages published against a schema.
// Structure is documented below.
SchemaSettings *TopicSchemaSettings `pulumi:"schemaSettings"`
}
type TopicState struct {
// The resource name of the Cloud KMS CryptoKey to be used to protect access
// to messages published on this topic. Your project's PubSub service account
// (`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have
// `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`
KmsKeyName pulumi.StringPtrInput
// A set of key/value label pairs to assign to this Topic.
Labels pulumi.StringMapInput
// Indicates the minimum duration to retain a message after it is published
// to the topic. If this field is set, messages published to the topic in
// the last messageRetentionDuration are always available to subscribers.
// For instance, it allows any attached subscription to seek to a timestamp
// that is up to messageRetentionDuration in the past. If this field is not
// set, message retention is controlled by settings on individual subscriptions.
// Cannot be more than 31 days or less than 10 minutes.
MessageRetentionDuration pulumi.StringPtrInput
// Policy constraining the set of Google Cloud Platform regions where
// messages published to the topic may be stored. If not present, then no
// constraints are in effect.
// Structure is documented below.
MessageStoragePolicy TopicMessageStoragePolicyPtrInput
// Name of the topic.
//
// ***
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
// Settings for validating messages published against a schema.
// Structure is documented below.
SchemaSettings TopicSchemaSettingsPtrInput
}
func (TopicState) ElementType() reflect.Type {
return reflect.TypeOf((*topicState)(nil)).Elem()
}
type topicArgs struct {
// The resource name of the Cloud KMS CryptoKey to be used to protect access
// to messages published on this topic. Your project's PubSub service account
// (`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have
// `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`
KmsKeyName *string `pulumi:"kmsKeyName"`
// A set of key/value label pairs to assign to this Topic.
Labels map[string]string `pulumi:"labels"`
// Indicates the minimum duration to retain a message after it is published
// to the topic. If this field is set, messages published to the topic in
// the last messageRetentionDuration are always available to subscribers.
// For instance, it allows any attached subscription to seek to a timestamp
// that is up to messageRetentionDuration in the past. If this field is not
// set, message retention is controlled by settings on individual subscriptions.
// Cannot be more than 31 days or less than 10 minutes.
MessageRetentionDuration *string `pulumi:"messageRetentionDuration"`
// Policy constraining the set of Google Cloud Platform regions where
// messages published to the topic may be stored. If not present, then no
// constraints are in effect.
// Structure is documented below.
MessageStoragePolicy *TopicMessageStoragePolicy `pulumi:"messageStoragePolicy"`
// Name of the topic.
//
// ***
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"`
// Settings for validating messages published against a schema.
// Structure is documented below.
SchemaSettings *TopicSchemaSettings `pulumi:"schemaSettings"`
}
// The set of arguments for constructing a Topic resource.
type TopicArgs struct {
// The resource name of the Cloud KMS CryptoKey to be used to protect access
// to messages published on this topic. Your project's PubSub service account
// (`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have
// `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`
KmsKeyName pulumi.StringPtrInput
// A set of key/value label pairs to assign to this Topic.
Labels pulumi.StringMapInput
// Indicates the minimum duration to retain a message after it is published
// to the topic. If this field is set, messages published to the topic in
// the last messageRetentionDuration are always available to subscribers.
// For instance, it allows any attached subscription to seek to a timestamp
// that is up to messageRetentionDuration in the past. If this field is not
// set, message retention is controlled by settings on individual subscriptions.
// Cannot be more than 31 days or less than 10 minutes.
MessageRetentionDuration pulumi.StringPtrInput
// Policy constraining the set of Google Cloud Platform regions where
// messages published to the topic may be stored. If not present, then no
// constraints are in effect.
// Structure is documented below.
MessageStoragePolicy TopicMessageStoragePolicyPtrInput
// Name of the topic.
//
// ***
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
// Settings for validating messages published against a schema.
// Structure is documented below.
SchemaSettings TopicSchemaSettingsPtrInput
}
func (TopicArgs) ElementType() reflect.Type {
return reflect.TypeOf((*topicArgs)(nil)).Elem()
}
type TopicInput interface {
pulumi.Input
ToTopicOutput() TopicOutput
ToTopicOutputWithContext(ctx context.Context) TopicOutput
}
func (*Topic) ElementType() reflect.Type {
return reflect.TypeOf((**Topic)(nil)).Elem()
}
func (i *Topic) ToTopicOutput() TopicOutput {
return i.ToTopicOutputWithContext(context.Background())
}
func (i *Topic) ToTopicOutputWithContext(ctx context.Context) TopicOutput {
return pulumi.ToOutputWithContext(ctx, i).(TopicOutput)
}
func (i *Topic) ToOutput(ctx context.Context) pulumix.Output[*Topic] {
return pulumix.Output[*Topic]{
OutputState: i.ToTopicOutputWithContext(ctx).OutputState,
}
}
// TopicArrayInput is an input type that accepts TopicArray and TopicArrayOutput values.
// You can construct a concrete instance of `TopicArrayInput` via:
//
// TopicArray{ TopicArgs{...} }
type TopicArrayInput interface {
pulumi.Input
ToTopicArrayOutput() TopicArrayOutput
ToTopicArrayOutputWithContext(context.Context) TopicArrayOutput
}
type TopicArray []TopicInput
func (TopicArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Topic)(nil)).Elem()
}
func (i TopicArray) ToTopicArrayOutput() TopicArrayOutput {
return i.ToTopicArrayOutputWithContext(context.Background())
}
func (i TopicArray) ToTopicArrayOutputWithContext(ctx context.Context) TopicArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TopicArrayOutput)
}
func (i TopicArray) ToOutput(ctx context.Context) pulumix.Output[[]*Topic] {
return pulumix.Output[[]*Topic]{
OutputState: i.ToTopicArrayOutputWithContext(ctx).OutputState,
}
}
// TopicMapInput is an input type that accepts TopicMap and TopicMapOutput values.
// You can construct a concrete instance of `TopicMapInput` via:
//
// TopicMap{ "key": TopicArgs{...} }
type TopicMapInput interface {
pulumi.Input
ToTopicMapOutput() TopicMapOutput
ToTopicMapOutputWithContext(context.Context) TopicMapOutput
}
type TopicMap map[string]TopicInput
func (TopicMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Topic)(nil)).Elem()
}
func (i TopicMap) ToTopicMapOutput() TopicMapOutput {
return i.ToTopicMapOutputWithContext(context.Background())
}
func (i TopicMap) ToTopicMapOutputWithContext(ctx context.Context) TopicMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TopicMapOutput)
}
func (i TopicMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Topic] {
return pulumix.Output[map[string]*Topic]{
OutputState: i.ToTopicMapOutputWithContext(ctx).OutputState,
}
}
type TopicOutput struct{ *pulumi.OutputState }
func (TopicOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Topic)(nil)).Elem()
}
func (o TopicOutput) ToTopicOutput() TopicOutput {
return o
}
func (o TopicOutput) ToTopicOutputWithContext(ctx context.Context) TopicOutput {
return o
}
func (o TopicOutput) ToOutput(ctx context.Context) pulumix.Output[*Topic] {
return pulumix.Output[*Topic]{
OutputState: o.OutputState,
}
}
// The resource name of the Cloud KMS CryptoKey to be used to protect access
// to messages published on this topic. Your project's PubSub service account
// (`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have
// `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`
func (o TopicOutput) KmsKeyName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Topic) pulumi.StringPtrOutput { return v.KmsKeyName }).(pulumi.StringPtrOutput)
}
// A set of key/value label pairs to assign to this Topic.
func (o TopicOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *Topic) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
// Indicates the minimum duration to retain a message after it is published
// to the topic. If this field is set, messages published to the topic in
// the last messageRetentionDuration are always available to subscribers.
// For instance, it allows any attached subscription to seek to a timestamp
// that is up to messageRetentionDuration in the past. If this field is not
// set, message retention is controlled by settings on individual subscriptions.
// Cannot be more than 31 days or less than 10 minutes.
func (o TopicOutput) MessageRetentionDuration() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Topic) pulumi.StringPtrOutput { return v.MessageRetentionDuration }).(pulumi.StringPtrOutput)
}
// Policy constraining the set of Google Cloud Platform regions where
// messages published to the topic may be stored. If not present, then no
// constraints are in effect.
// Structure is documented below.
func (o TopicOutput) MessageStoragePolicy() TopicMessageStoragePolicyOutput {
return o.ApplyT(func(v *Topic) TopicMessageStoragePolicyOutput { return v.MessageStoragePolicy }).(TopicMessageStoragePolicyOutput)
}
// Name of the topic.
//
// ***
func (o TopicOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Topic) 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 TopicOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Topic) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// Settings for validating messages published against a schema.
// Structure is documented below.
func (o TopicOutput) SchemaSettings() TopicSchemaSettingsOutput {
return o.ApplyT(func(v *Topic) TopicSchemaSettingsOutput { return v.SchemaSettings }).(TopicSchemaSettingsOutput)
}
type TopicArrayOutput struct{ *pulumi.OutputState }
func (TopicArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Topic)(nil)).Elem()
}
func (o TopicArrayOutput) ToTopicArrayOutput() TopicArrayOutput {
return o
}
func (o TopicArrayOutput) ToTopicArrayOutputWithContext(ctx context.Context) TopicArrayOutput {
return o
}
func (o TopicArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Topic] {
return pulumix.Output[[]*Topic]{
OutputState: o.OutputState,
}
}
func (o TopicArrayOutput) Index(i pulumi.IntInput) TopicOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Topic {
return vs[0].([]*Topic)[vs[1].(int)]
}).(TopicOutput)
}
type TopicMapOutput struct{ *pulumi.OutputState }
func (TopicMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Topic)(nil)).Elem()
}
func (o TopicMapOutput) ToTopicMapOutput() TopicMapOutput {
return o
}
func (o TopicMapOutput) ToTopicMapOutputWithContext(ctx context.Context) TopicMapOutput {
return o
}
func (o TopicMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Topic] {
return pulumix.Output[map[string]*Topic]{
OutputState: o.OutputState,
}
}
func (o TopicMapOutput) MapIndex(k pulumi.StringInput) TopicOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Topic {
return vs[0].(map[string]*Topic)[vs[1].(string)]
}).(TopicOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TopicInput)(nil)).Elem(), &Topic{})
pulumi.RegisterInputType(reflect.TypeOf((*TopicArrayInput)(nil)).Elem(), TopicArray{})
pulumi.RegisterInputType(reflect.TypeOf((*TopicMapInput)(nil)).Elem(), TopicMap{})
pulumi.RegisterOutputType(TopicOutput{})
pulumi.RegisterOutputType(TopicArrayOutput{})
pulumi.RegisterOutputType(TopicMapOutput{})
}