/
ioTHub.go
599 lines (539 loc) · 25 KB
/
ioTHub.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
// *** 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 iot
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages an IotHub
//
// > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported.
//
// > **NOTE:** Routes can be defined either directly on the `iot.IoTHub` resource, or using the `iot.Route` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur.
//
// > **NOTE:** Enrichments can be defined either directly on the `iot.IoTHub` resource, or using the `iot.Enrichment` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur.
//
// > **NOTE:** Fallback route can be defined either directly on the `iot.IoTHub` resource, or using the `iot.FallbackRoute` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/eventhub"
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/iot"
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/storage"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// AccountTier: pulumi.String("Standard"),
// AccountReplicationType: pulumi.String("LRS"),
// })
// if err != nil {
// return err
// }
// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{
// StorageAccountName: exampleAccount.Name,
// ContainerAccessType: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// Sku: pulumi.String("Basic"),
// })
// if err != nil {
// return err
// }
// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// NamespaceName: exampleEventHubNamespace.Name,
// PartitionCount: pulumi.Int(2),
// MessageRetention: pulumi.Int(1),
// })
// if err != nil {
// return err
// }
// exampleAuthorizationRule, err := eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// NamespaceName: exampleEventHubNamespace.Name,
// EventhubName: exampleEventHub.Name,
// Send: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// _, err = iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{
// ResourceGroupName: exampleResourceGroup.Name,
// Location: exampleResourceGroup.Location,
// Sku: &iot.IoTHubSkuArgs{
// Name: pulumi.String("S1"),
// Capacity: pulumi.Int(1),
// },
// Endpoints: iot.IoTHubEndpointArray{
// &iot.IoTHubEndpointArgs{
// Type: pulumi.String("AzureIotHub.StorageContainer"),
// ConnectionString: exampleAccount.PrimaryBlobConnectionString,
// Name: pulumi.String("export"),
// BatchFrequencyInSeconds: pulumi.Int(60),
// MaxChunkSizeInBytes: pulumi.Int(10485760),
// ContainerName: exampleContainer.Name,
// Encoding: pulumi.String("Avro"),
// FileNameFormat: pulumi.String("{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"),
// },
// &iot.IoTHubEndpointArgs{
// Type: pulumi.String("AzureIotHub.EventHub"),
// ConnectionString: exampleAuthorizationRule.PrimaryConnectionString,
// Name: pulumi.String("export2"),
// },
// },
// Routes: iot.IoTHubRouteArray{
// &iot.IoTHubRouteArgs{
// Name: pulumi.String("export"),
// Source: pulumi.String("DeviceMessages"),
// Condition: pulumi.String("true"),
// EndpointNames: pulumi.StringArray{
// pulumi.String("export"),
// },
// Enabled: pulumi.Bool(true),
// },
// &iot.IoTHubRouteArgs{
// Name: pulumi.String("export2"),
// Source: pulumi.String("DeviceMessages"),
// Condition: pulumi.String("true"),
// EndpointNames: pulumi.StringArray{
// pulumi.String("export2"),
// },
// Enabled: pulumi.Bool(true),
// },
// },
// Enrichments: iot.IoTHubEnrichmentArray{
// &iot.IoTHubEnrichmentArgs{
// Key: pulumi.String("tenant"),
// Value: pulumi.String(fmt.Sprintf("%v%v", "$", "twin.tags.Tenant")),
// EndpointNames: pulumi.StringArray{
// pulumi.String("export"),
// pulumi.String("export2"),
// },
// },
// },
// Tags: pulumi.StringMap{
// "purpose": pulumi.String("testing"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// IoTHubs can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:iot/ioTHub:IoTHub hub1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/IotHubs/hub1
// ```
type IoTHub struct {
pulumi.CustomResourceState
// An `endpoint` block as defined below.
Endpoints IoTHubEndpointArrayOutput `pulumi:"endpoints"`
// A `enrichment` block as defined below.
Enrichments IoTHubEnrichmentArrayOutput `pulumi:"enrichments"`
// The EventHub compatible endpoint for events data
EventHubEventsEndpoint pulumi.StringOutput `pulumi:"eventHubEventsEndpoint"`
// The EventHub compatible path for events data
EventHubEventsPath pulumi.StringOutput `pulumi:"eventHubEventsPath"`
// The EventHub compatible endpoint for operational data
EventHubOperationsEndpoint pulumi.StringOutput `pulumi:"eventHubOperationsEndpoint"`
// The EventHub compatible path for operational data
EventHubOperationsPath pulumi.StringOutput `pulumi:"eventHubOperationsPath"`
// The number of device-to-cloud partitions used by backing event hubs. Must be between `2` and `128`.
EventHubPartitionCount pulumi.IntOutput `pulumi:"eventHubPartitionCount"`
// The event hub retention to use in days. Must be between `1` and `7`.
EventHubRetentionInDays pulumi.IntOutput `pulumi:"eventHubRetentionInDays"`
// A `fallbackRoute` block as defined below. If the fallback route is enabled, messages that don't match any of the supplied routes are automatically sent to this route. Defaults to messages/events.
FallbackRoute IoTHubFallbackRouteOutput `pulumi:"fallbackRoute"`
// A `fileUpload` block as defined below.
FileUpload IoTHubFileUploadPtrOutput `pulumi:"fileUpload"`
// The hostname of the IotHub Resource.
Hostname pulumi.StringOutput `pulumi:"hostname"`
// One or more `ipFilterRule` blocks as defined below.
IpFilterRules IoTHubIpFilterRuleArrayOutput `pulumi:"ipFilterRules"`
// Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// Specifies the minimum TLS version to support for this hub. The only valid value is `1.2`. Changing this forces a new resource to be created.
MinTlsVersion pulumi.StringPtrOutput `pulumi:"minTlsVersion"`
// Specifies the name of the IotHub resource. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Is the IotHub resource accessible from a public network?
PublicNetworkAccessEnabled pulumi.BoolPtrOutput `pulumi:"publicNetworkAccessEnabled"`
// The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A `route` block as defined below.
Routes IoTHubRouteArrayOutput `pulumi:"routes"`
// One or more `sharedAccessPolicy` blocks as defined below.
SharedAccessPolicies IoTHubSharedAccessPolicyArrayOutput `pulumi:"sharedAccessPolicies"`
// A `sku` block as defined below.
Sku IoTHubSkuOutput `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the endpoint. Possible values are `AzureIotHub.StorageContainer`, `AzureIotHub.ServiceBusQueue`, `AzureIotHub.ServiceBusTopic` or `AzureIotHub.EventHub`.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewIoTHub registers a new resource with the given unique name, arguments, and options.
func NewIoTHub(ctx *pulumi.Context,
name string, args *IoTHubArgs, opts ...pulumi.ResourceOption) (*IoTHub, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.Sku == nil {
return nil, errors.New("invalid value for required argument 'Sku'")
}
var resource IoTHub
err := ctx.RegisterResource("azure:iot/ioTHub:IoTHub", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIoTHub gets an existing IoTHub 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 GetIoTHub(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IoTHubState, opts ...pulumi.ResourceOption) (*IoTHub, error) {
var resource IoTHub
err := ctx.ReadResource("azure:iot/ioTHub:IoTHub", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IoTHub resources.
type ioTHubState struct {
// An `endpoint` block as defined below.
Endpoints []IoTHubEndpoint `pulumi:"endpoints"`
// A `enrichment` block as defined below.
Enrichments []IoTHubEnrichment `pulumi:"enrichments"`
// The EventHub compatible endpoint for events data
EventHubEventsEndpoint *string `pulumi:"eventHubEventsEndpoint"`
// The EventHub compatible path for events data
EventHubEventsPath *string `pulumi:"eventHubEventsPath"`
// The EventHub compatible endpoint for operational data
EventHubOperationsEndpoint *string `pulumi:"eventHubOperationsEndpoint"`
// The EventHub compatible path for operational data
EventHubOperationsPath *string `pulumi:"eventHubOperationsPath"`
// The number of device-to-cloud partitions used by backing event hubs. Must be between `2` and `128`.
EventHubPartitionCount *int `pulumi:"eventHubPartitionCount"`
// The event hub retention to use in days. Must be between `1` and `7`.
EventHubRetentionInDays *int `pulumi:"eventHubRetentionInDays"`
// A `fallbackRoute` block as defined below. If the fallback route is enabled, messages that don't match any of the supplied routes are automatically sent to this route. Defaults to messages/events.
FallbackRoute *IoTHubFallbackRoute `pulumi:"fallbackRoute"`
// A `fileUpload` block as defined below.
FileUpload *IoTHubFileUpload `pulumi:"fileUpload"`
// The hostname of the IotHub Resource.
Hostname *string `pulumi:"hostname"`
// One or more `ipFilterRule` blocks as defined below.
IpFilterRules []IoTHubIpFilterRule `pulumi:"ipFilterRules"`
// Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the minimum TLS version to support for this hub. The only valid value is `1.2`. Changing this forces a new resource to be created.
MinTlsVersion *string `pulumi:"minTlsVersion"`
// Specifies the name of the IotHub resource. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Is the IotHub resource accessible from a public network?
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A `route` block as defined below.
Routes []IoTHubRoute `pulumi:"routes"`
// One or more `sharedAccessPolicy` blocks as defined below.
SharedAccessPolicies []IoTHubSharedAccessPolicy `pulumi:"sharedAccessPolicies"`
// A `sku` block as defined below.
Sku *IoTHubSku `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// The type of the endpoint. Possible values are `AzureIotHub.StorageContainer`, `AzureIotHub.ServiceBusQueue`, `AzureIotHub.ServiceBusTopic` or `AzureIotHub.EventHub`.
Type *string `pulumi:"type"`
}
type IoTHubState struct {
// An `endpoint` block as defined below.
Endpoints IoTHubEndpointArrayInput
// A `enrichment` block as defined below.
Enrichments IoTHubEnrichmentArrayInput
// The EventHub compatible endpoint for events data
EventHubEventsEndpoint pulumi.StringPtrInput
// The EventHub compatible path for events data
EventHubEventsPath pulumi.StringPtrInput
// The EventHub compatible endpoint for operational data
EventHubOperationsEndpoint pulumi.StringPtrInput
// The EventHub compatible path for operational data
EventHubOperationsPath pulumi.StringPtrInput
// The number of device-to-cloud partitions used by backing event hubs. Must be between `2` and `128`.
EventHubPartitionCount pulumi.IntPtrInput
// The event hub retention to use in days. Must be between `1` and `7`.
EventHubRetentionInDays pulumi.IntPtrInput
// A `fallbackRoute` block as defined below. If the fallback route is enabled, messages that don't match any of the supplied routes are automatically sent to this route. Defaults to messages/events.
FallbackRoute IoTHubFallbackRoutePtrInput
// A `fileUpload` block as defined below.
FileUpload IoTHubFileUploadPtrInput
// The hostname of the IotHub Resource.
Hostname pulumi.StringPtrInput
// One or more `ipFilterRule` blocks as defined below.
IpFilterRules IoTHubIpFilterRuleArrayInput
// Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the minimum TLS version to support for this hub. The only valid value is `1.2`. Changing this forces a new resource to be created.
MinTlsVersion pulumi.StringPtrInput
// Specifies the name of the IotHub resource. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Is the IotHub resource accessible from a public network?
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A `route` block as defined below.
Routes IoTHubRouteArrayInput
// One or more `sharedAccessPolicy` blocks as defined below.
SharedAccessPolicies IoTHubSharedAccessPolicyArrayInput
// A `sku` block as defined below.
Sku IoTHubSkuPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// The type of the endpoint. Possible values are `AzureIotHub.StorageContainer`, `AzureIotHub.ServiceBusQueue`, `AzureIotHub.ServiceBusTopic` or `AzureIotHub.EventHub`.
Type pulumi.StringPtrInput
}
func (IoTHubState) ElementType() reflect.Type {
return reflect.TypeOf((*ioTHubState)(nil)).Elem()
}
type ioTHubArgs struct {
// An `endpoint` block as defined below.
Endpoints []IoTHubEndpoint `pulumi:"endpoints"`
// A `enrichment` block as defined below.
Enrichments []IoTHubEnrichment `pulumi:"enrichments"`
// The number of device-to-cloud partitions used by backing event hubs. Must be between `2` and `128`.
EventHubPartitionCount *int `pulumi:"eventHubPartitionCount"`
// The event hub retention to use in days. Must be between `1` and `7`.
EventHubRetentionInDays *int `pulumi:"eventHubRetentionInDays"`
// A `fallbackRoute` block as defined below. If the fallback route is enabled, messages that don't match any of the supplied routes are automatically sent to this route. Defaults to messages/events.
FallbackRoute *IoTHubFallbackRoute `pulumi:"fallbackRoute"`
// A `fileUpload` block as defined below.
FileUpload *IoTHubFileUpload `pulumi:"fileUpload"`
// One or more `ipFilterRule` blocks as defined below.
IpFilterRules []IoTHubIpFilterRule `pulumi:"ipFilterRules"`
// Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the minimum TLS version to support for this hub. The only valid value is `1.2`. Changing this forces a new resource to be created.
MinTlsVersion *string `pulumi:"minTlsVersion"`
// Specifies the name of the IotHub resource. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Is the IotHub resource accessible from a public network?
PublicNetworkAccessEnabled *bool `pulumi:"publicNetworkAccessEnabled"`
// The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A `route` block as defined below.
Routes []IoTHubRoute `pulumi:"routes"`
// A `sku` block as defined below.
Sku IoTHubSku `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a IoTHub resource.
type IoTHubArgs struct {
// An `endpoint` block as defined below.
Endpoints IoTHubEndpointArrayInput
// A `enrichment` block as defined below.
Enrichments IoTHubEnrichmentArrayInput
// The number of device-to-cloud partitions used by backing event hubs. Must be between `2` and `128`.
EventHubPartitionCount pulumi.IntPtrInput
// The event hub retention to use in days. Must be between `1` and `7`.
EventHubRetentionInDays pulumi.IntPtrInput
// A `fallbackRoute` block as defined below. If the fallback route is enabled, messages that don't match any of the supplied routes are automatically sent to this route. Defaults to messages/events.
FallbackRoute IoTHubFallbackRoutePtrInput
// A `fileUpload` block as defined below.
FileUpload IoTHubFileUploadPtrInput
// One or more `ipFilterRule` blocks as defined below.
IpFilterRules IoTHubIpFilterRuleArrayInput
// Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// Specifies the minimum TLS version to support for this hub. The only valid value is `1.2`. Changing this forces a new resource to be created.
MinTlsVersion pulumi.StringPtrInput
// Specifies the name of the IotHub resource. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Is the IotHub resource accessible from a public network?
PublicNetworkAccessEnabled pulumi.BoolPtrInput
// The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A `route` block as defined below.
Routes IoTHubRouteArrayInput
// A `sku` block as defined below.
Sku IoTHubSkuInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
}
func (IoTHubArgs) ElementType() reflect.Type {
return reflect.TypeOf((*ioTHubArgs)(nil)).Elem()
}
type IoTHubInput interface {
pulumi.Input
ToIoTHubOutput() IoTHubOutput
ToIoTHubOutputWithContext(ctx context.Context) IoTHubOutput
}
func (*IoTHub) ElementType() reflect.Type {
return reflect.TypeOf((*IoTHub)(nil))
}
func (i *IoTHub) ToIoTHubOutput() IoTHubOutput {
return i.ToIoTHubOutputWithContext(context.Background())
}
func (i *IoTHub) ToIoTHubOutputWithContext(ctx context.Context) IoTHubOutput {
return pulumi.ToOutputWithContext(ctx, i).(IoTHubOutput)
}
func (i *IoTHub) ToIoTHubPtrOutput() IoTHubPtrOutput {
return i.ToIoTHubPtrOutputWithContext(context.Background())
}
func (i *IoTHub) ToIoTHubPtrOutputWithContext(ctx context.Context) IoTHubPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(IoTHubPtrOutput)
}
type IoTHubPtrInput interface {
pulumi.Input
ToIoTHubPtrOutput() IoTHubPtrOutput
ToIoTHubPtrOutputWithContext(ctx context.Context) IoTHubPtrOutput
}
type ioTHubPtrType IoTHubArgs
func (*ioTHubPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**IoTHub)(nil))
}
func (i *ioTHubPtrType) ToIoTHubPtrOutput() IoTHubPtrOutput {
return i.ToIoTHubPtrOutputWithContext(context.Background())
}
func (i *ioTHubPtrType) ToIoTHubPtrOutputWithContext(ctx context.Context) IoTHubPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(IoTHubPtrOutput)
}
// IoTHubArrayInput is an input type that accepts IoTHubArray and IoTHubArrayOutput values.
// You can construct a concrete instance of `IoTHubArrayInput` via:
//
// IoTHubArray{ IoTHubArgs{...} }
type IoTHubArrayInput interface {
pulumi.Input
ToIoTHubArrayOutput() IoTHubArrayOutput
ToIoTHubArrayOutputWithContext(context.Context) IoTHubArrayOutput
}
type IoTHubArray []IoTHubInput
func (IoTHubArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*IoTHub)(nil))
}
func (i IoTHubArray) ToIoTHubArrayOutput() IoTHubArrayOutput {
return i.ToIoTHubArrayOutputWithContext(context.Background())
}
func (i IoTHubArray) ToIoTHubArrayOutputWithContext(ctx context.Context) IoTHubArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IoTHubArrayOutput)
}
// IoTHubMapInput is an input type that accepts IoTHubMap and IoTHubMapOutput values.
// You can construct a concrete instance of `IoTHubMapInput` via:
//
// IoTHubMap{ "key": IoTHubArgs{...} }
type IoTHubMapInput interface {
pulumi.Input
ToIoTHubMapOutput() IoTHubMapOutput
ToIoTHubMapOutputWithContext(context.Context) IoTHubMapOutput
}
type IoTHubMap map[string]IoTHubInput
func (IoTHubMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*IoTHub)(nil))
}
func (i IoTHubMap) ToIoTHubMapOutput() IoTHubMapOutput {
return i.ToIoTHubMapOutputWithContext(context.Background())
}
func (i IoTHubMap) ToIoTHubMapOutputWithContext(ctx context.Context) IoTHubMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IoTHubMapOutput)
}
type IoTHubOutput struct {
*pulumi.OutputState
}
func (IoTHubOutput) ElementType() reflect.Type {
return reflect.TypeOf((*IoTHub)(nil))
}
func (o IoTHubOutput) ToIoTHubOutput() IoTHubOutput {
return o
}
func (o IoTHubOutput) ToIoTHubOutputWithContext(ctx context.Context) IoTHubOutput {
return o
}
func (o IoTHubOutput) ToIoTHubPtrOutput() IoTHubPtrOutput {
return o.ToIoTHubPtrOutputWithContext(context.Background())
}
func (o IoTHubOutput) ToIoTHubPtrOutputWithContext(ctx context.Context) IoTHubPtrOutput {
return o.ApplyT(func(v IoTHub) *IoTHub {
return &v
}).(IoTHubPtrOutput)
}
type IoTHubPtrOutput struct {
*pulumi.OutputState
}
func (IoTHubPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**IoTHub)(nil))
}
func (o IoTHubPtrOutput) ToIoTHubPtrOutput() IoTHubPtrOutput {
return o
}
func (o IoTHubPtrOutput) ToIoTHubPtrOutputWithContext(ctx context.Context) IoTHubPtrOutput {
return o
}
type IoTHubArrayOutput struct{ *pulumi.OutputState }
func (IoTHubArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]IoTHub)(nil))
}
func (o IoTHubArrayOutput) ToIoTHubArrayOutput() IoTHubArrayOutput {
return o
}
func (o IoTHubArrayOutput) ToIoTHubArrayOutputWithContext(ctx context.Context) IoTHubArrayOutput {
return o
}
func (o IoTHubArrayOutput) Index(i pulumi.IntInput) IoTHubOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) IoTHub {
return vs[0].([]IoTHub)[vs[1].(int)]
}).(IoTHubOutput)
}
type IoTHubMapOutput struct{ *pulumi.OutputState }
func (IoTHubMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]IoTHub)(nil))
}
func (o IoTHubMapOutput) ToIoTHubMapOutput() IoTHubMapOutput {
return o
}
func (o IoTHubMapOutput) ToIoTHubMapOutputWithContext(ctx context.Context) IoTHubMapOutput {
return o
}
func (o IoTHubMapOutput) MapIndex(k pulumi.StringInput) IoTHubOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) IoTHub {
return vs[0].(map[string]IoTHub)[vs[1].(string)]
}).(IoTHubOutput)
}
func init() {
pulumi.RegisterOutputType(IoTHubOutput{})
pulumi.RegisterOutputType(IoTHubPtrOutput{})
pulumi.RegisterOutputType(IoTHubArrayOutput{})
pulumi.RegisterOutputType(IoTHubMapOutput{})
}