@aws-cdk/aws-ec2-alpha 2.156.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/route.d.ts ADDED
@@ -0,0 +1,390 @@
1
+ import { CfnEgressOnlyInternetGateway, CfnInternetGateway, CfnNatGateway, CfnRoute, CfnRouteTable, CfnVPNGateway, IRouteTable, ISubnet, IVpcEndpoint, RouterType, VpnConnectionType } from 'aws-cdk-lib/aws-ec2';
2
+ import { Construct, IDependable } from 'constructs';
3
+ import { Duration, Resource } from 'aws-cdk-lib/core';
4
+ import { IVpcV2 } from './vpc-v2-base';
5
+ /**
6
+ * Indicates whether the NAT gateway supports public or private connectivity.
7
+ * The default is public connectivity.
8
+ * See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-natgateway.html#cfn-ec2-natgateway-connectivitytype
9
+ */
10
+ export declare enum NatConnectivityType {
11
+ /**
12
+ * Sets Connectivity type to PUBLIC
13
+ */
14
+ PUBLIC = "public",
15
+ /**
16
+ * Sets Connectivity type to PRIVATE
17
+ */
18
+ PRIVATE = "private"
19
+ }
20
+ /**
21
+ * Interface to define a routing target, such as an
22
+ * egress-only internet gateway or VPC endpoint.
23
+ */
24
+ export interface IRouteTarget {
25
+ /**
26
+ * The type of router used in the route.
27
+ */
28
+ readonly routerType: RouterType;
29
+ /**
30
+ * The ID of the route target.
31
+ */
32
+ readonly routerTargetId: string;
33
+ }
34
+ /**
35
+ * Properties to define an egress-only internet gateway.
36
+ */
37
+ export interface EgressOnlyInternetGatewayProps {
38
+ /**
39
+ * The ID of the VPC for which to create the egress-only internet gateway.
40
+ */
41
+ readonly vpc: IVpcV2;
42
+ /**
43
+ * The resource name of the egress-only internet gateway.
44
+ * @default none
45
+ */
46
+ readonly egressOnlyInternetGatewayName?: string;
47
+ }
48
+ /**
49
+ * Properties to define an internet gateway.
50
+ */
51
+ export interface InternetGatewayProps {
52
+ /**
53
+ * The ID of the VPC for which to create the internet gateway.
54
+ */
55
+ readonly vpc: IVpcV2;
56
+ /**
57
+ * The resource name of the internet gateway.
58
+ * @default none
59
+ */
60
+ readonly internetGatewayName?: string;
61
+ }
62
+ /**
63
+ * Properties to define a VPN gateway.
64
+ */
65
+ export interface VPNGatewayProps {
66
+ /**
67
+ * The type of VPN connection the virtual private gateway supports.
68
+ * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpngateway.html#cfn-ec2-vpngateway-type
69
+ */
70
+ readonly type: VpnConnectionType;
71
+ /**
72
+ * The ID of the VPC for which to create the VPN gateway.
73
+ */
74
+ readonly vpc: IVpcV2;
75
+ /**
76
+ * The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
77
+ * @default none
78
+ */
79
+ readonly amazonSideAsn?: number;
80
+ /**
81
+ * The resource name of the VPN gateway.
82
+ * @default none
83
+ */
84
+ readonly vpnGatewayName?: string;
85
+ }
86
+ /**
87
+ * Properties to define a NAT gateway.
88
+ */
89
+ export interface NatGatewayProps {
90
+ /**
91
+ * The subnet in which the NAT gateway is located.
92
+ */
93
+ readonly subnet: ISubnet;
94
+ /**
95
+ * The ID of the VPC in which the NAT gateway is located.
96
+ * @default none
97
+ */
98
+ readonly vpc?: IVpcV2;
99
+ /**
100
+ * AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT
101
+ * gateway and cannot be specified with a private NAT gateway.
102
+ * @default attr.allocationID of a new Elastic IP created by default
103
+ * //TODO: ADD L2 for elastic ip
104
+ */
105
+ readonly allocationId?: string;
106
+ /**
107
+ * Indicates whether the NAT gateway supports public or private connectivity.
108
+ * @default public
109
+ */
110
+ readonly connectivityType?: NatConnectivityType;
111
+ /**
112
+ * The maximum amount of time to wait before forcibly releasing the
113
+ * IP addresses if connections are still in progress.
114
+ * @default 350 seconds
115
+ */
116
+ readonly maxDrainDuration?: Duration;
117
+ /**
118
+ * The private IPv4 address to assign to the NAT gateway. If you don't provide an
119
+ * address, a private IPv4 address will be automatically assigned.
120
+ * @default none
121
+ */
122
+ readonly privateIpAddress?: string;
123
+ /**
124
+ * Secondary EIP allocation IDs.
125
+ * @default none
126
+ * @see https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
127
+ */
128
+ readonly secondaryAllocationIds?: string[];
129
+ /**
130
+ * The number of secondary private IPv4 addresses you
131
+ * want to assign to the NAT gateway.
132
+ *
133
+ * `SecondaryPrivateIpAddressCount` and `SecondaryPrivateIpAddresses` cannot be
134
+ * set at the same time.
135
+ *
136
+ * @default none
137
+ * @see https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
138
+ */
139
+ readonly secondaryPrivateIpAddressCount?: number;
140
+ /**
141
+ * Secondary private IPv4 addresses.
142
+ *
143
+ * `SecondaryPrivateIpAddressCount` and `SecondaryPrivateIpAddresses` cannot be
144
+ * set at the same time.
145
+ *
146
+ * @default none
147
+ * @see https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
148
+ */
149
+ readonly secondaryPrivateIpAddresses?: string[];
150
+ /**
151
+ * The resource name of the NAT gateway.
152
+ * @default none
153
+ */
154
+ readonly natGatewayName?: string;
155
+ }
156
+ /**
157
+ * Creates an egress-only internet gateway
158
+ * @resource AWS::EC2::EgressOnlyInternetGateway
159
+ */
160
+ export declare class EgressOnlyInternetGateway extends Resource implements IRouteTarget {
161
+ /**
162
+ * The type of router used in the route.
163
+ */
164
+ readonly routerType: RouterType;
165
+ /**
166
+ * The ID of the route target.
167
+ */
168
+ readonly routerTargetId: string;
169
+ /**
170
+ * The egress-only internet gateway CFN resource.
171
+ */
172
+ readonly resource: CfnEgressOnlyInternetGateway;
173
+ constructor(scope: Construct, id: string, props: EgressOnlyInternetGatewayProps);
174
+ }
175
+ /**
176
+ * Creates an internet gateway
177
+ * @resource AWS::EC2::InternetGateway
178
+ */
179
+ export declare class InternetGateway extends Resource implements IRouteTarget {
180
+ /**
181
+ * The type of router used in the route.
182
+ */
183
+ readonly routerType: RouterType;
184
+ /**
185
+ * The ID of the route target.
186
+ */
187
+ readonly routerTargetId: string;
188
+ /**
189
+ * The ID of the VPC for which to create the internet gateway.
190
+ */
191
+ readonly vpcId: string;
192
+ /**
193
+ * The internet gateway CFN resource.
194
+ */
195
+ readonly resource: CfnInternetGateway;
196
+ constructor(scope: Construct, id: string, props: InternetGatewayProps);
197
+ }
198
+ /**
199
+ * Creates a virtual private gateway
200
+ * @resource AWS::EC2::VPNGateway
201
+ */
202
+ export declare class VPNGateway extends Resource implements IRouteTarget {
203
+ /**
204
+ * The type of router used in the route.
205
+ */
206
+ readonly routerType: RouterType;
207
+ /**
208
+ * The ID of the route target.
209
+ */
210
+ readonly routerTargetId: string;
211
+ /**
212
+ * The ID of the VPC for which to create the VPN gateway.
213
+ */
214
+ readonly vpcId: string;
215
+ /**
216
+ * The VPN gateway CFN resource.
217
+ */
218
+ readonly resource: CfnVPNGateway;
219
+ constructor(scope: Construct, id: string, props: VPNGatewayProps);
220
+ }
221
+ /**
222
+ * Creates a network address translation (NAT) gateway
223
+ * @resource AWS::EC2::NatGateway
224
+ */
225
+ export declare class NatGateway extends Resource implements IRouteTarget {
226
+ /**
227
+ * The type of router used in the route.
228
+ */
229
+ readonly routerType: RouterType;
230
+ /**
231
+ * The ID of the route target.
232
+ */
233
+ readonly routerTargetId: string;
234
+ /**
235
+ * Indicates whether the NAT gateway supports public or private connectivity.
236
+ * @default public
237
+ */
238
+ readonly connectivityType?: string;
239
+ /**
240
+ * The maximum amount of time to wait before forcibly releasing the
241
+ * IP addresses if connections are still in progress.
242
+ * @default 350 seconds
243
+ */
244
+ readonly maxDrainDuration?: Duration;
245
+ /**
246
+ * The NAT gateway CFN resource.
247
+ */
248
+ readonly resource: CfnNatGateway;
249
+ constructor(scope: Construct, id: string, props: NatGatewayProps);
250
+ }
251
+ /**
252
+ * The type of endpoint or gateway being targeted by the route.
253
+ */
254
+ export interface RouteTargetProps {
255
+ /**
256
+ * The gateway route target. This is used for targets such as
257
+ * egress-only internet gateway or VPC peering connection.
258
+ * @default none
259
+ */
260
+ readonly gateway?: IRouteTarget;
261
+ /**
262
+ * The endpoint route target. This is used for targets such as
263
+ * VPC endpoints.
264
+ * @default none
265
+ */
266
+ readonly endpoint?: IVpcEndpoint;
267
+ }
268
+ /**
269
+ * The gateway or endpoint targeted by the route.
270
+ */
271
+ export declare class RouteTargetType {
272
+ /**
273
+ * The gateway route target. This is used for targets such as
274
+ * egress-only internet gateway or VPC peering connection.
275
+ * @default none
276
+ */
277
+ readonly gateway?: IRouteTarget;
278
+ /**
279
+ * The endpoint route target. This is used for targets such as
280
+ * VPC endpoints.
281
+ * @default none
282
+ */
283
+ readonly endpoint?: IVpcEndpoint;
284
+ constructor(props: RouteTargetProps);
285
+ }
286
+ /**
287
+ * Interface to define a route.
288
+ */
289
+ export interface IRouteV2 {
290
+ /**
291
+ * The ID of the route table for the route.
292
+ * @attribute routeTable
293
+ */
294
+ readonly routeTable: IRouteTable;
295
+ /**
296
+ * The IPv4 or IPv6 CIDR block used for the destination match.
297
+ *
298
+ * Routing decisions are based on the most specific match.
299
+ * TODO: Look for strong IP type implementation here.
300
+ */
301
+ readonly destination: string;
302
+ /**
303
+ * The gateway or endpoint targeted by the route.
304
+ */
305
+ readonly target: RouteTargetType;
306
+ }
307
+ /**
308
+ * Properties to define a route.
309
+ */
310
+ export interface RouteProps {
311
+ /**
312
+ * The ID of the route table for the route.
313
+ * @attribute routeTable
314
+ */
315
+ readonly routeTable: IRouteTable;
316
+ /**
317
+ * The IPv4 or IPv6 CIDR block used for the destination match.
318
+ *
319
+ * Routing decisions are based on the most specific match.
320
+ */
321
+ readonly destination: string;
322
+ /**
323
+ * The gateway or endpoint targeted by the route.
324
+ */
325
+ readonly target: RouteTargetType;
326
+ /**
327
+ * The resource name of the route.
328
+ * @default none
329
+ */
330
+ readonly routeName?: string;
331
+ }
332
+ /**
333
+ * Creates a new route with added functionality.
334
+ * @resource AWS::EC2::Route
335
+ */
336
+ export declare class Route extends Resource implements IRouteV2 {
337
+ /**
338
+ * The IPv4 or IPv6 CIDR block used for the destination match.
339
+ *
340
+ * Routing decisions are based on the most specific match.
341
+ */
342
+ readonly destination: string;
343
+ /**
344
+ * The gateway or endpoint targeted by the route.
345
+ */
346
+ readonly target: RouteTargetType;
347
+ /**
348
+ * The route table for the route.
349
+ * @attribute routeTable
350
+ */
351
+ readonly routeTable: IRouteTable;
352
+ /**
353
+ * The type of router the route is targetting
354
+ */
355
+ readonly targetRouterType: RouterType;
356
+ /**
357
+ * The route CFN resource.
358
+ */
359
+ readonly resource?: CfnRoute;
360
+ constructor(scope: Construct, id: string, props: RouteProps);
361
+ }
362
+ /**
363
+ * Properties to define a route table.
364
+ */
365
+ export interface RouteTableProps {
366
+ /**
367
+ * The ID of the VPC.
368
+ */
369
+ readonly vpc: IVpcV2;
370
+ /**
371
+ * The resource name of the route table.
372
+ * @default none
373
+ */
374
+ readonly routeTableName?: string;
375
+ }
376
+ /**
377
+ * Creates a route table for the specified VPC
378
+ * @resource AWS::EC2::RouteTable
379
+ */
380
+ export declare class RouteTable extends Resource implements IRouteTable, IDependable {
381
+ /**
382
+ * The ID of the route table.
383
+ */
384
+ readonly routeTableId: string;
385
+ /**
386
+ * The route table CFN resource.
387
+ */
388
+ readonly resource: CfnRouteTable;
389
+ constructor(scope: Construct, id: string, props: RouteTableProps);
390
+ }