/
route.go
595 lines (531 loc) · 23.5 KB
/
route.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
// 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 ec2
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to create a routing table entry (a route) in a VPC routing table.
//
// > **NOTE on Route Tables and Routes:** This provider currently provides both a standalone Route resource and a Route Table resource with routes defined in-line. At this time you cannot use a Route Table with in-line routes in conjunction with any Route resources. Doing so will cause a conflict of rule settings and will overwrite rules.
//
// > **NOTE on `gatewayId` attribute:** The AWS API is very forgiving with the resource ID passed in the `gatewayId` attribute. For example an `ec2.Route` resource can be created with an `ec2.NatGateway` or `ec2.EgressOnlyInternetGateway` ID specified for the `gatewayId` attribute. Specifying anything other than an `ec2.InternetGateway` or `ec2.VpnGateway` ID will lead to this provider reporting a permanent diff between your configuration and recorded state, as the AWS API returns the more-specific attribute. If you are experiencing constant diffs with an `ec2.Route` resource, the first thing to check is that the correct attribute is being specified.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2.NewRoute(ctx, "r", &ec2.RouteArgs{
// RouteTableId: pulumi.Any(testing.Id),
// DestinationCidrBlock: pulumi.String("10.0.1.0/22"),
// VpcPeeringConnectionId: pulumi.String("pcx-45ff3dc1"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Example IPv6 Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// vpc, err := ec2.NewVpc(ctx, "vpc", &ec2.VpcArgs{
// CidrBlock: pulumi.String("10.1.0.0/16"),
// AssignGeneratedIpv6CidrBlock: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// egress, err := ec2.NewEgressOnlyInternetGateway(ctx, "egress", &ec2.EgressOnlyInternetGatewayArgs{
// VpcId: vpc.ID(),
// })
// if err != nil {
// return err
// }
// _, err = ec2.NewRoute(ctx, "r", &ec2.RouteArgs{
// RouteTableId: pulumi.String("rtb-4fbb3ac4"),
// DestinationIpv6CidrBlock: pulumi.String("::/0"),
// EgressOnlyGatewayId: egress.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Import a route in route table `rtb-656C65616E6F72` with an IPv6 destination CIDR of `2620:0:2d0:200::8/125`:
//
// Import a route in route table `rtb-656C65616E6F72` with a managed prefix list destination of `pl-0570a1d2d725c16be`:
//
// __Using `pulumi import` to import__ individual routes using `ROUTETABLEID_DESTINATION`. Import [local routes](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html#RouteTables) using the VPC's IPv4 or IPv6 CIDR blocks. For example:
//
// Import a route in route table `rtb-656C65616E6F72` with an IPv4 destination CIDR of `10.42.0.0/16`:
//
// ```sh
// $ pulumi import aws:ec2/route:Route my_route rtb-656C65616E6F72_10.42.0.0/16
// ```
// Import a route in route table `rtb-656C65616E6F72` with an IPv6 destination CIDR of `2620:0:2d0:200::8/125`:
//
// ```sh
// $ pulumi import aws:ec2/route:Route my_route rtb-656C65616E6F72_2620:0:2d0:200::8/125
// ```
// Import a route in route table `rtb-656C65616E6F72` with a managed prefix list destination of `pl-0570a1d2d725c16be`:
//
// ```sh
// $ pulumi import aws:ec2/route:Route my_route rtb-656C65616E6F72_pl-0570a1d2d725c16be
// ```
type Route struct {
pulumi.CustomResourceState
// Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
CarrierGatewayId pulumi.StringPtrOutput `pulumi:"carrierGatewayId"`
// The Amazon Resource Name (ARN) of a core network.
CoreNetworkArn pulumi.StringPtrOutput `pulumi:"coreNetworkArn"`
// The destination CIDR block.
DestinationCidrBlock pulumi.StringPtrOutput `pulumi:"destinationCidrBlock"`
// The destination IPv6 CIDR block.
DestinationIpv6CidrBlock pulumi.StringPtrOutput `pulumi:"destinationIpv6CidrBlock"`
// The ID of a managed prefix list destination.
//
// One of the following target arguments must be supplied:
DestinationPrefixListId pulumi.StringPtrOutput `pulumi:"destinationPrefixListId"`
// Identifier of a VPC Egress Only Internet Gateway.
EgressOnlyGatewayId pulumi.StringPtrOutput `pulumi:"egressOnlyGatewayId"`
// Identifier of a VPC internet gateway or a virtual private gateway. Specify `local` when updating a previously imported local route.
GatewayId pulumi.StringPtrOutput `pulumi:"gatewayId"`
// Identifier of an EC2 instance.
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// The AWS account ID of the owner of the EC2 instance.
InstanceOwnerId pulumi.StringOutput `pulumi:"instanceOwnerId"`
// Identifier of a Outpost local gateway.
LocalGatewayId pulumi.StringPtrOutput `pulumi:"localGatewayId"`
// Identifier of a VPC NAT gateway.
NatGatewayId pulumi.StringPtrOutput `pulumi:"natGatewayId"`
// Identifier of an EC2 network interface.
NetworkInterfaceId pulumi.StringOutput `pulumi:"networkInterfaceId"`
// How the route was created - `CreateRouteTable`, `CreateRoute` or `EnableVgwRoutePropagation`.
Origin pulumi.StringOutput `pulumi:"origin"`
// The ID of the routing table.
//
// One of the following destination arguments must be supplied:
RouteTableId pulumi.StringOutput `pulumi:"routeTableId"`
// The state of the route - `active` or `blackhole`.
State pulumi.StringOutput `pulumi:"state"`
// Identifier of an EC2 Transit Gateway.
TransitGatewayId pulumi.StringPtrOutput `pulumi:"transitGatewayId"`
// Identifier of a VPC Endpoint.
VpcEndpointId pulumi.StringPtrOutput `pulumi:"vpcEndpointId"`
// Identifier of a VPC peering connection.
//
// Note that the default route, mapping the VPC's CIDR block to "local", is created implicitly and cannot be specified.
VpcPeeringConnectionId pulumi.StringPtrOutput `pulumi:"vpcPeeringConnectionId"`
}
// NewRoute registers a new resource with the given unique name, arguments, and options.
func NewRoute(ctx *pulumi.Context,
name string, args *RouteArgs, opts ...pulumi.ResourceOption) (*Route, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RouteTableId == nil {
return nil, errors.New("invalid value for required argument 'RouteTableId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Route
err := ctx.RegisterResource("aws:ec2/route:Route", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRoute gets an existing Route 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 GetRoute(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RouteState, opts ...pulumi.ResourceOption) (*Route, error) {
var resource Route
err := ctx.ReadResource("aws:ec2/route:Route", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Route resources.
type routeState struct {
// Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
CarrierGatewayId *string `pulumi:"carrierGatewayId"`
// The Amazon Resource Name (ARN) of a core network.
CoreNetworkArn *string `pulumi:"coreNetworkArn"`
// The destination CIDR block.
DestinationCidrBlock *string `pulumi:"destinationCidrBlock"`
// The destination IPv6 CIDR block.
DestinationIpv6CidrBlock *string `pulumi:"destinationIpv6CidrBlock"`
// The ID of a managed prefix list destination.
//
// One of the following target arguments must be supplied:
DestinationPrefixListId *string `pulumi:"destinationPrefixListId"`
// Identifier of a VPC Egress Only Internet Gateway.
EgressOnlyGatewayId *string `pulumi:"egressOnlyGatewayId"`
// Identifier of a VPC internet gateway or a virtual private gateway. Specify `local` when updating a previously imported local route.
GatewayId *string `pulumi:"gatewayId"`
// Identifier of an EC2 instance.
InstanceId *string `pulumi:"instanceId"`
// The AWS account ID of the owner of the EC2 instance.
InstanceOwnerId *string `pulumi:"instanceOwnerId"`
// Identifier of a Outpost local gateway.
LocalGatewayId *string `pulumi:"localGatewayId"`
// Identifier of a VPC NAT gateway.
NatGatewayId *string `pulumi:"natGatewayId"`
// Identifier of an EC2 network interface.
NetworkInterfaceId *string `pulumi:"networkInterfaceId"`
// How the route was created - `CreateRouteTable`, `CreateRoute` or `EnableVgwRoutePropagation`.
Origin *string `pulumi:"origin"`
// The ID of the routing table.
//
// One of the following destination arguments must be supplied:
RouteTableId *string `pulumi:"routeTableId"`
// The state of the route - `active` or `blackhole`.
State *string `pulumi:"state"`
// Identifier of an EC2 Transit Gateway.
TransitGatewayId *string `pulumi:"transitGatewayId"`
// Identifier of a VPC Endpoint.
VpcEndpointId *string `pulumi:"vpcEndpointId"`
// Identifier of a VPC peering connection.
//
// Note that the default route, mapping the VPC's CIDR block to "local", is created implicitly and cannot be specified.
VpcPeeringConnectionId *string `pulumi:"vpcPeeringConnectionId"`
}
type RouteState struct {
// Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
CarrierGatewayId pulumi.StringPtrInput
// The Amazon Resource Name (ARN) of a core network.
CoreNetworkArn pulumi.StringPtrInput
// The destination CIDR block.
DestinationCidrBlock pulumi.StringPtrInput
// The destination IPv6 CIDR block.
DestinationIpv6CidrBlock pulumi.StringPtrInput
// The ID of a managed prefix list destination.
//
// One of the following target arguments must be supplied:
DestinationPrefixListId pulumi.StringPtrInput
// Identifier of a VPC Egress Only Internet Gateway.
EgressOnlyGatewayId pulumi.StringPtrInput
// Identifier of a VPC internet gateway or a virtual private gateway. Specify `local` when updating a previously imported local route.
GatewayId pulumi.StringPtrInput
// Identifier of an EC2 instance.
InstanceId pulumi.StringPtrInput
// The AWS account ID of the owner of the EC2 instance.
InstanceOwnerId pulumi.StringPtrInput
// Identifier of a Outpost local gateway.
LocalGatewayId pulumi.StringPtrInput
// Identifier of a VPC NAT gateway.
NatGatewayId pulumi.StringPtrInput
// Identifier of an EC2 network interface.
NetworkInterfaceId pulumi.StringPtrInput
// How the route was created - `CreateRouteTable`, `CreateRoute` or `EnableVgwRoutePropagation`.
Origin pulumi.StringPtrInput
// The ID of the routing table.
//
// One of the following destination arguments must be supplied:
RouteTableId pulumi.StringPtrInput
// The state of the route - `active` or `blackhole`.
State pulumi.StringPtrInput
// Identifier of an EC2 Transit Gateway.
TransitGatewayId pulumi.StringPtrInput
// Identifier of a VPC Endpoint.
VpcEndpointId pulumi.StringPtrInput
// Identifier of a VPC peering connection.
//
// Note that the default route, mapping the VPC's CIDR block to "local", is created implicitly and cannot be specified.
VpcPeeringConnectionId pulumi.StringPtrInput
}
func (RouteState) ElementType() reflect.Type {
return reflect.TypeOf((*routeState)(nil)).Elem()
}
type routeArgs struct {
// Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
CarrierGatewayId *string `pulumi:"carrierGatewayId"`
// The Amazon Resource Name (ARN) of a core network.
CoreNetworkArn *string `pulumi:"coreNetworkArn"`
// The destination CIDR block.
DestinationCidrBlock *string `pulumi:"destinationCidrBlock"`
// The destination IPv6 CIDR block.
DestinationIpv6CidrBlock *string `pulumi:"destinationIpv6CidrBlock"`
// The ID of a managed prefix list destination.
//
// One of the following target arguments must be supplied:
DestinationPrefixListId *string `pulumi:"destinationPrefixListId"`
// Identifier of a VPC Egress Only Internet Gateway.
EgressOnlyGatewayId *string `pulumi:"egressOnlyGatewayId"`
// Identifier of a VPC internet gateway or a virtual private gateway. Specify `local` when updating a previously imported local route.
GatewayId *string `pulumi:"gatewayId"`
// Identifier of a Outpost local gateway.
LocalGatewayId *string `pulumi:"localGatewayId"`
// Identifier of a VPC NAT gateway.
NatGatewayId *string `pulumi:"natGatewayId"`
// Identifier of an EC2 network interface.
NetworkInterfaceId *string `pulumi:"networkInterfaceId"`
// The ID of the routing table.
//
// One of the following destination arguments must be supplied:
RouteTableId string `pulumi:"routeTableId"`
// Identifier of an EC2 Transit Gateway.
TransitGatewayId *string `pulumi:"transitGatewayId"`
// Identifier of a VPC Endpoint.
VpcEndpointId *string `pulumi:"vpcEndpointId"`
// Identifier of a VPC peering connection.
//
// Note that the default route, mapping the VPC's CIDR block to "local", is created implicitly and cannot be specified.
VpcPeeringConnectionId *string `pulumi:"vpcPeeringConnectionId"`
}
// The set of arguments for constructing a Route resource.
type RouteArgs struct {
// Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
CarrierGatewayId pulumi.StringPtrInput
// The Amazon Resource Name (ARN) of a core network.
CoreNetworkArn pulumi.StringPtrInput
// The destination CIDR block.
DestinationCidrBlock pulumi.StringPtrInput
// The destination IPv6 CIDR block.
DestinationIpv6CidrBlock pulumi.StringPtrInput
// The ID of a managed prefix list destination.
//
// One of the following target arguments must be supplied:
DestinationPrefixListId pulumi.StringPtrInput
// Identifier of a VPC Egress Only Internet Gateway.
EgressOnlyGatewayId pulumi.StringPtrInput
// Identifier of a VPC internet gateway or a virtual private gateway. Specify `local` when updating a previously imported local route.
GatewayId pulumi.StringPtrInput
// Identifier of a Outpost local gateway.
LocalGatewayId pulumi.StringPtrInput
// Identifier of a VPC NAT gateway.
NatGatewayId pulumi.StringPtrInput
// Identifier of an EC2 network interface.
NetworkInterfaceId pulumi.StringPtrInput
// The ID of the routing table.
//
// One of the following destination arguments must be supplied:
RouteTableId pulumi.StringInput
// Identifier of an EC2 Transit Gateway.
TransitGatewayId pulumi.StringPtrInput
// Identifier of a VPC Endpoint.
VpcEndpointId pulumi.StringPtrInput
// Identifier of a VPC peering connection.
//
// Note that the default route, mapping the VPC's CIDR block to "local", is created implicitly and cannot be specified.
VpcPeeringConnectionId pulumi.StringPtrInput
}
func (RouteArgs) ElementType() reflect.Type {
return reflect.TypeOf((*routeArgs)(nil)).Elem()
}
type RouteInput interface {
pulumi.Input
ToRouteOutput() RouteOutput
ToRouteOutputWithContext(ctx context.Context) RouteOutput
}
func (*Route) ElementType() reflect.Type {
return reflect.TypeOf((**Route)(nil)).Elem()
}
func (i *Route) ToRouteOutput() RouteOutput {
return i.ToRouteOutputWithContext(context.Background())
}
func (i *Route) ToRouteOutputWithContext(ctx context.Context) RouteOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteOutput)
}
// RouteArrayInput is an input type that accepts RouteArray and RouteArrayOutput values.
// You can construct a concrete instance of `RouteArrayInput` via:
//
// RouteArray{ RouteArgs{...} }
type RouteArrayInput interface {
pulumi.Input
ToRouteArrayOutput() RouteArrayOutput
ToRouteArrayOutputWithContext(context.Context) RouteArrayOutput
}
type RouteArray []RouteInput
func (RouteArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Route)(nil)).Elem()
}
func (i RouteArray) ToRouteArrayOutput() RouteArrayOutput {
return i.ToRouteArrayOutputWithContext(context.Background())
}
func (i RouteArray) ToRouteArrayOutputWithContext(ctx context.Context) RouteArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteArrayOutput)
}
// RouteMapInput is an input type that accepts RouteMap and RouteMapOutput values.
// You can construct a concrete instance of `RouteMapInput` via:
//
// RouteMap{ "key": RouteArgs{...} }
type RouteMapInput interface {
pulumi.Input
ToRouteMapOutput() RouteMapOutput
ToRouteMapOutputWithContext(context.Context) RouteMapOutput
}
type RouteMap map[string]RouteInput
func (RouteMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Route)(nil)).Elem()
}
func (i RouteMap) ToRouteMapOutput() RouteMapOutput {
return i.ToRouteMapOutputWithContext(context.Background())
}
func (i RouteMap) ToRouteMapOutputWithContext(ctx context.Context) RouteMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteMapOutput)
}
type RouteOutput struct{ *pulumi.OutputState }
func (RouteOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Route)(nil)).Elem()
}
func (o RouteOutput) ToRouteOutput() RouteOutput {
return o
}
func (o RouteOutput) ToRouteOutputWithContext(ctx context.Context) RouteOutput {
return o
}
// Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
func (o RouteOutput) CarrierGatewayId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.CarrierGatewayId }).(pulumi.StringPtrOutput)
}
// The Amazon Resource Name (ARN) of a core network.
func (o RouteOutput) CoreNetworkArn() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.CoreNetworkArn }).(pulumi.StringPtrOutput)
}
// The destination CIDR block.
func (o RouteOutput) DestinationCidrBlock() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.DestinationCidrBlock }).(pulumi.StringPtrOutput)
}
// The destination IPv6 CIDR block.
func (o RouteOutput) DestinationIpv6CidrBlock() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.DestinationIpv6CidrBlock }).(pulumi.StringPtrOutput)
}
// The ID of a managed prefix list destination.
//
// One of the following target arguments must be supplied:
func (o RouteOutput) DestinationPrefixListId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.DestinationPrefixListId }).(pulumi.StringPtrOutput)
}
// Identifier of a VPC Egress Only Internet Gateway.
func (o RouteOutput) EgressOnlyGatewayId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.EgressOnlyGatewayId }).(pulumi.StringPtrOutput)
}
// Identifier of a VPC internet gateway or a virtual private gateway. Specify `local` when updating a previously imported local route.
func (o RouteOutput) GatewayId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.GatewayId }).(pulumi.StringPtrOutput)
}
// Identifier of an EC2 instance.
func (o RouteOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
// The AWS account ID of the owner of the EC2 instance.
func (o RouteOutput) InstanceOwnerId() pulumi.StringOutput {
return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.InstanceOwnerId }).(pulumi.StringOutput)
}
// Identifier of a Outpost local gateway.
func (o RouteOutput) LocalGatewayId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.LocalGatewayId }).(pulumi.StringPtrOutput)
}
// Identifier of a VPC NAT gateway.
func (o RouteOutput) NatGatewayId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.NatGatewayId }).(pulumi.StringPtrOutput)
}
// Identifier of an EC2 network interface.
func (o RouteOutput) NetworkInterfaceId() pulumi.StringOutput {
return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.NetworkInterfaceId }).(pulumi.StringOutput)
}
// How the route was created - `CreateRouteTable`, `CreateRoute` or `EnableVgwRoutePropagation`.
func (o RouteOutput) Origin() pulumi.StringOutput {
return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.Origin }).(pulumi.StringOutput)
}
// The ID of the routing table.
//
// One of the following destination arguments must be supplied:
func (o RouteOutput) RouteTableId() pulumi.StringOutput {
return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.RouteTableId }).(pulumi.StringOutput)
}
// The state of the route - `active` or `blackhole`.
func (o RouteOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// Identifier of an EC2 Transit Gateway.
func (o RouteOutput) TransitGatewayId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.TransitGatewayId }).(pulumi.StringPtrOutput)
}
// Identifier of a VPC Endpoint.
func (o RouteOutput) VpcEndpointId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.VpcEndpointId }).(pulumi.StringPtrOutput)
}
// Identifier of a VPC peering connection.
//
// Note that the default route, mapping the VPC's CIDR block to "local", is created implicitly and cannot be specified.
func (o RouteOutput) VpcPeeringConnectionId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.VpcPeeringConnectionId }).(pulumi.StringPtrOutput)
}
type RouteArrayOutput struct{ *pulumi.OutputState }
func (RouteArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Route)(nil)).Elem()
}
func (o RouteArrayOutput) ToRouteArrayOutput() RouteArrayOutput {
return o
}
func (o RouteArrayOutput) ToRouteArrayOutputWithContext(ctx context.Context) RouteArrayOutput {
return o
}
func (o RouteArrayOutput) Index(i pulumi.IntInput) RouteOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Route {
return vs[0].([]*Route)[vs[1].(int)]
}).(RouteOutput)
}
type RouteMapOutput struct{ *pulumi.OutputState }
func (RouteMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Route)(nil)).Elem()
}
func (o RouteMapOutput) ToRouteMapOutput() RouteMapOutput {
return o
}
func (o RouteMapOutput) ToRouteMapOutputWithContext(ctx context.Context) RouteMapOutput {
return o
}
func (o RouteMapOutput) MapIndex(k pulumi.StringInput) RouteOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Route {
return vs[0].(map[string]*Route)[vs[1].(string)]
}).(RouteOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RouteInput)(nil)).Elem(), &Route{})
pulumi.RegisterInputType(reflect.TypeOf((*RouteArrayInput)(nil)).Elem(), RouteArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RouteMapInput)(nil)).Elem(), RouteMap{})
pulumi.RegisterOutputType(RouteOutput{})
pulumi.RegisterOutputType(RouteArrayOutput{})
pulumi.RegisterOutputType(RouteMapOutput{})
}