/
switch.go
600 lines (541 loc) · 20.3 KB
/
switch.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
// 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 vpc
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a VPC Vswitch resource. ## Module Support
//
// You can use to the existing vpc module to create a VPC and several VSwitches one-click.
//
// For information about VPC Vswitch and how to use it, see [What is Vswitch](https://www.alibabacloud.com/help/en/virtual-private-cloud/latest/work-with-vswitches).
//
// > **NOTE:** Available since v1.0.0.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
// AvailableResourceCreation: pulumi.StringRef("VSwitch"),
// }, nil)
// if err != nil {
// return err
// }
// fooNetwork, err := vpc.NewNetwork(ctx, "foo", &vpc.NetworkArgs{
// VpcName: pulumi.String("terraform-example"),
// CidrBlock: pulumi.String("172.16.0.0/12"),
// })
// if err != nil {
// return err
// }
// _, err = vpc.NewSwitch(ctx, "foo", &vpc.SwitchArgs{
// VswitchName: pulumi.String("terraform-example"),
// CidrBlock: pulumi.String("172.16.0.0/21"),
// VpcId: fooNetwork.ID(),
// ZoneId: pulumi.String(foo.Zones[0].Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
// AvailableResourceCreation: pulumi.StringRef("VSwitch"),
// }, nil)
// if err != nil {
// return err
// }
// vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
// VpcName: pulumi.String("terraform-example"),
// CidrBlock: pulumi.String("172.16.0.0/12"),
// })
// if err != nil {
// return err
// }
// cidrBlocks, err := vpc.NewIpv4CidrBlock(ctx, "cidr_blocks", &vpc.Ipv4CidrBlockArgs{
// VpcId: vpc.ID(),
// SecondaryCidrBlock: pulumi.String("192.163.0.0/16"),
// })
// if err != nil {
// return err
// }
// _, err = vpc.NewSwitch(ctx, "island-nat", &vpc.SwitchArgs{
// VpcId: cidrBlocks.VpcId,
// CidrBlock: pulumi.String("172.16.0.0/21"),
// ZoneId: pulumi.String(foo.Zones[0].Id),
// VswitchName: pulumi.String("terraform-example"),
// Tags: pulumi.Map{
// "BuiltBy": pulumi.Any("example_value"),
// "cnm_version": pulumi.Any("example_value"),
// "Environment": pulumi.Any("example_value"),
// "ManagedBy": pulumi.Any("example_value"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// # Create a switch associated with the additional network segment
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
// AvailableResourceCreation: pulumi.StringRef("VSwitch"),
// }, nil)
// if err != nil {
// return err
// }
// fooNetwork, err := vpc.NewNetwork(ctx, "foo", &vpc.NetworkArgs{
// VpcName: pulumi.String("terraform-example"),
// CidrBlock: pulumi.String("172.16.0.0/12"),
// })
// if err != nil {
// return err
// }
// fooIpv4CidrBlock, err := vpc.NewIpv4CidrBlock(ctx, "foo", &vpc.Ipv4CidrBlockArgs{
// VpcId: fooNetwork.ID(),
// SecondaryCidrBlock: pulumi.String("192.163.0.0/16"),
// })
// if err != nil {
// return err
// }
// _, err = vpc.NewSwitch(ctx, "foo", &vpc.SwitchArgs{
// VpcId: fooIpv4CidrBlock.VpcId,
// CidrBlock: pulumi.String("192.163.0.0/24"),
// ZoneId: pulumi.String(foo.Zones[0].Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// VPC Vswitch can be imported using the id, e.g.
//
// ```sh
// $ pulumi import alicloud:vpc/switch:Switch example <id>
// ```
type Switch struct {
pulumi.CustomResourceState
// Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
//
// Deprecated: Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
AvailabilityZone pulumi.StringOutput `pulumi:"availabilityZone"`
// The IPv4 CIDR block of the VSwitch.
CidrBlock pulumi.StringOutput `pulumi:"cidrBlock"`
// The creation time of the VSwitch.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// The description of VSwitch.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Whether the IPv6 function is enabled in the switch. Value:
// - **true**: enables IPv6.
// - **false** (default): IPv6 is not enabled.
EnableIpv6 pulumi.BoolPtrOutput `pulumi:"enableIpv6"`
// The IPv6 CIDR block of the VSwitch.
Ipv6CidrBlock pulumi.StringOutput `pulumi:"ipv6CidrBlock"`
// The IPv6 CIDR block of the VSwitch.
Ipv6CidrBlockMask pulumi.IntOutput `pulumi:"ipv6CidrBlockMask"`
// Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
//
// Deprecated: Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
Name pulumi.StringOutput `pulumi:"name"`
// The status of the resource.
Status pulumi.StringOutput `pulumi:"status"`
// The tags of VSwitch.
Tags pulumi.MapOutput `pulumi:"tags"`
// The VPC ID.
//
// The following arguments will be discarded. Please use new fields as soon as possible:
VpcId pulumi.StringOutput `pulumi:"vpcId"`
// The name of the VSwitch.
VswitchName pulumi.StringOutput `pulumi:"vswitchName"`
// The AZ for the VSwitch. **Note:** Required for a VPC VSwitch.
ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}
// NewSwitch registers a new resource with the given unique name, arguments, and options.
func NewSwitch(ctx *pulumi.Context,
name string, args *SwitchArgs, opts ...pulumi.ResourceOption) (*Switch, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CidrBlock == nil {
return nil, errors.New("invalid value for required argument 'CidrBlock'")
}
if args.VpcId == nil {
return nil, errors.New("invalid value for required argument 'VpcId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Switch
err := ctx.RegisterResource("alicloud:vpc/switch:Switch", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSwitch gets an existing Switch 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 GetSwitch(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SwitchState, opts ...pulumi.ResourceOption) (*Switch, error) {
var resource Switch
err := ctx.ReadResource("alicloud:vpc/switch:Switch", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Switch resources.
type switchState struct {
// Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
//
// Deprecated: Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
AvailabilityZone *string `pulumi:"availabilityZone"`
// The IPv4 CIDR block of the VSwitch.
CidrBlock *string `pulumi:"cidrBlock"`
// The creation time of the VSwitch.
CreateTime *string `pulumi:"createTime"`
// The description of VSwitch.
Description *string `pulumi:"description"`
// Whether the IPv6 function is enabled in the switch. Value:
// - **true**: enables IPv6.
// - **false** (default): IPv6 is not enabled.
EnableIpv6 *bool `pulumi:"enableIpv6"`
// The IPv6 CIDR block of the VSwitch.
Ipv6CidrBlock *string `pulumi:"ipv6CidrBlock"`
// The IPv6 CIDR block of the VSwitch.
Ipv6CidrBlockMask *int `pulumi:"ipv6CidrBlockMask"`
// Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
//
// Deprecated: Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
Name *string `pulumi:"name"`
// The status of the resource.
Status *string `pulumi:"status"`
// The tags of VSwitch.
Tags map[string]interface{} `pulumi:"tags"`
// The VPC ID.
//
// The following arguments will be discarded. Please use new fields as soon as possible:
VpcId *string `pulumi:"vpcId"`
// The name of the VSwitch.
VswitchName *string `pulumi:"vswitchName"`
// The AZ for the VSwitch. **Note:** Required for a VPC VSwitch.
ZoneId *string `pulumi:"zoneId"`
}
type SwitchState struct {
// Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
//
// Deprecated: Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
AvailabilityZone pulumi.StringPtrInput
// The IPv4 CIDR block of the VSwitch.
CidrBlock pulumi.StringPtrInput
// The creation time of the VSwitch.
CreateTime pulumi.StringPtrInput
// The description of VSwitch.
Description pulumi.StringPtrInput
// Whether the IPv6 function is enabled in the switch. Value:
// - **true**: enables IPv6.
// - **false** (default): IPv6 is not enabled.
EnableIpv6 pulumi.BoolPtrInput
// The IPv6 CIDR block of the VSwitch.
Ipv6CidrBlock pulumi.StringPtrInput
// The IPv6 CIDR block of the VSwitch.
Ipv6CidrBlockMask pulumi.IntPtrInput
// Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
//
// Deprecated: Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
Name pulumi.StringPtrInput
// The status of the resource.
Status pulumi.StringPtrInput
// The tags of VSwitch.
Tags pulumi.MapInput
// The VPC ID.
//
// The following arguments will be discarded. Please use new fields as soon as possible:
VpcId pulumi.StringPtrInput
// The name of the VSwitch.
VswitchName pulumi.StringPtrInput
// The AZ for the VSwitch. **Note:** Required for a VPC VSwitch.
ZoneId pulumi.StringPtrInput
}
func (SwitchState) ElementType() reflect.Type {
return reflect.TypeOf((*switchState)(nil)).Elem()
}
type switchArgs struct {
// Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
//
// Deprecated: Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
AvailabilityZone *string `pulumi:"availabilityZone"`
// The IPv4 CIDR block of the VSwitch.
CidrBlock string `pulumi:"cidrBlock"`
// The description of VSwitch.
Description *string `pulumi:"description"`
// Whether the IPv6 function is enabled in the switch. Value:
// - **true**: enables IPv6.
// - **false** (default): IPv6 is not enabled.
EnableIpv6 *bool `pulumi:"enableIpv6"`
// The IPv6 CIDR block of the VSwitch.
Ipv6CidrBlockMask *int `pulumi:"ipv6CidrBlockMask"`
// Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
//
// Deprecated: Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
Name *string `pulumi:"name"`
// The tags of VSwitch.
Tags map[string]interface{} `pulumi:"tags"`
// The VPC ID.
//
// The following arguments will be discarded. Please use new fields as soon as possible:
VpcId string `pulumi:"vpcId"`
// The name of the VSwitch.
VswitchName *string `pulumi:"vswitchName"`
// The AZ for the VSwitch. **Note:** Required for a VPC VSwitch.
ZoneId *string `pulumi:"zoneId"`
}
// The set of arguments for constructing a Switch resource.
type SwitchArgs struct {
// Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
//
// Deprecated: Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
AvailabilityZone pulumi.StringPtrInput
// The IPv4 CIDR block of the VSwitch.
CidrBlock pulumi.StringInput
// The description of VSwitch.
Description pulumi.StringPtrInput
// Whether the IPv6 function is enabled in the switch. Value:
// - **true**: enables IPv6.
// - **false** (default): IPv6 is not enabled.
EnableIpv6 pulumi.BoolPtrInput
// The IPv6 CIDR block of the VSwitch.
Ipv6CidrBlockMask pulumi.IntPtrInput
// Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
//
// Deprecated: Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
Name pulumi.StringPtrInput
// The tags of VSwitch.
Tags pulumi.MapInput
// The VPC ID.
//
// The following arguments will be discarded. Please use new fields as soon as possible:
VpcId pulumi.StringInput
// The name of the VSwitch.
VswitchName pulumi.StringPtrInput
// The AZ for the VSwitch. **Note:** Required for a VPC VSwitch.
ZoneId pulumi.StringPtrInput
}
func (SwitchArgs) ElementType() reflect.Type {
return reflect.TypeOf((*switchArgs)(nil)).Elem()
}
type SwitchInput interface {
pulumi.Input
ToSwitchOutput() SwitchOutput
ToSwitchOutputWithContext(ctx context.Context) SwitchOutput
}
func (*Switch) ElementType() reflect.Type {
return reflect.TypeOf((**Switch)(nil)).Elem()
}
func (i *Switch) ToSwitchOutput() SwitchOutput {
return i.ToSwitchOutputWithContext(context.Background())
}
func (i *Switch) ToSwitchOutputWithContext(ctx context.Context) SwitchOutput {
return pulumi.ToOutputWithContext(ctx, i).(SwitchOutput)
}
// SwitchArrayInput is an input type that accepts SwitchArray and SwitchArrayOutput values.
// You can construct a concrete instance of `SwitchArrayInput` via:
//
// SwitchArray{ SwitchArgs{...} }
type SwitchArrayInput interface {
pulumi.Input
ToSwitchArrayOutput() SwitchArrayOutput
ToSwitchArrayOutputWithContext(context.Context) SwitchArrayOutput
}
type SwitchArray []SwitchInput
func (SwitchArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Switch)(nil)).Elem()
}
func (i SwitchArray) ToSwitchArrayOutput() SwitchArrayOutput {
return i.ToSwitchArrayOutputWithContext(context.Background())
}
func (i SwitchArray) ToSwitchArrayOutputWithContext(ctx context.Context) SwitchArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SwitchArrayOutput)
}
// SwitchMapInput is an input type that accepts SwitchMap and SwitchMapOutput values.
// You can construct a concrete instance of `SwitchMapInput` via:
//
// SwitchMap{ "key": SwitchArgs{...} }
type SwitchMapInput interface {
pulumi.Input
ToSwitchMapOutput() SwitchMapOutput
ToSwitchMapOutputWithContext(context.Context) SwitchMapOutput
}
type SwitchMap map[string]SwitchInput
func (SwitchMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Switch)(nil)).Elem()
}
func (i SwitchMap) ToSwitchMapOutput() SwitchMapOutput {
return i.ToSwitchMapOutputWithContext(context.Background())
}
func (i SwitchMap) ToSwitchMapOutputWithContext(ctx context.Context) SwitchMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SwitchMapOutput)
}
type SwitchOutput struct{ *pulumi.OutputState }
func (SwitchOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Switch)(nil)).Elem()
}
func (o SwitchOutput) ToSwitchOutput() SwitchOutput {
return o
}
func (o SwitchOutput) ToSwitchOutputWithContext(ctx context.Context) SwitchOutput {
return o
}
// Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
//
// Deprecated: Field 'availability_zone' has been deprecated from provider version 1.119.0. New field 'zone_id' instead.
func (o SwitchOutput) AvailabilityZone() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.AvailabilityZone }).(pulumi.StringOutput)
}
// The IPv4 CIDR block of the VSwitch.
func (o SwitchOutput) CidrBlock() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.CidrBlock }).(pulumi.StringOutput)
}
// The creation time of the VSwitch.
func (o SwitchOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// The description of VSwitch.
func (o SwitchOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Switch) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Whether the IPv6 function is enabled in the switch. Value:
// - **true**: enables IPv6.
// - **false** (default): IPv6 is not enabled.
func (o SwitchOutput) EnableIpv6() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Switch) pulumi.BoolPtrOutput { return v.EnableIpv6 }).(pulumi.BoolPtrOutput)
}
// The IPv6 CIDR block of the VSwitch.
func (o SwitchOutput) Ipv6CidrBlock() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.Ipv6CidrBlock }).(pulumi.StringOutput)
}
// The IPv6 CIDR block of the VSwitch.
func (o SwitchOutput) Ipv6CidrBlockMask() pulumi.IntOutput {
return o.ApplyT(func(v *Switch) pulumi.IntOutput { return v.Ipv6CidrBlockMask }).(pulumi.IntOutput)
}
// Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
//
// Deprecated: Field 'name' has been deprecated from provider version 1.119.0. New field 'vswitch_name' instead.
func (o SwitchOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The status of the resource.
func (o SwitchOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// The tags of VSwitch.
func (o SwitchOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v *Switch) pulumi.MapOutput { return v.Tags }).(pulumi.MapOutput)
}
// The VPC ID.
//
// The following arguments will be discarded. Please use new fields as soon as possible:
func (o SwitchOutput) VpcId() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
}
// The name of the VSwitch.
func (o SwitchOutput) VswitchName() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.VswitchName }).(pulumi.StringOutput)
}
// The AZ for the VSwitch. **Note:** Required for a VPC VSwitch.
func (o SwitchOutput) ZoneId() pulumi.StringOutput {
return o.ApplyT(func(v *Switch) pulumi.StringOutput { return v.ZoneId }).(pulumi.StringOutput)
}
type SwitchArrayOutput struct{ *pulumi.OutputState }
func (SwitchArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Switch)(nil)).Elem()
}
func (o SwitchArrayOutput) ToSwitchArrayOutput() SwitchArrayOutput {
return o
}
func (o SwitchArrayOutput) ToSwitchArrayOutputWithContext(ctx context.Context) SwitchArrayOutput {
return o
}
func (o SwitchArrayOutput) Index(i pulumi.IntInput) SwitchOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Switch {
return vs[0].([]*Switch)[vs[1].(int)]
}).(SwitchOutput)
}
type SwitchMapOutput struct{ *pulumi.OutputState }
func (SwitchMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Switch)(nil)).Elem()
}
func (o SwitchMapOutput) ToSwitchMapOutput() SwitchMapOutput {
return o
}
func (o SwitchMapOutput) ToSwitchMapOutputWithContext(ctx context.Context) SwitchMapOutput {
return o
}
func (o SwitchMapOutput) MapIndex(k pulumi.StringInput) SwitchOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Switch {
return vs[0].(map[string]*Switch)[vs[1].(string)]
}).(SwitchOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SwitchInput)(nil)).Elem(), &Switch{})
pulumi.RegisterInputType(reflect.TypeOf((*SwitchArrayInput)(nil)).Elem(), SwitchArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SwitchMapInput)(nil)).Elem(), SwitchMap{})
pulumi.RegisterOutputType(SwitchOutput{})
pulumi.RegisterOutputType(SwitchArrayOutput{})
pulumi.RegisterOutputType(SwitchMapOutput{})
}