aws-cdk.aws-ec2-alpha 2.158.0a0__py3-none-any.whl → 2.159.0a0__py3-none-any.whl
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.
Potentially problematic release.
This version of aws-cdk.aws-ec2-alpha might be problematic. Click here for more details.
- aws_cdk/aws_ec2_alpha/__init__.py +1662 -540
- aws_cdk/aws_ec2_alpha/_jsii/__init__.py +2 -2
- aws_cdk/aws_ec2_alpha/_jsii/aws-ec2-alpha@2.159.0-alpha.0.jsii.tgz +0 -0
- aws_cdk.aws_ec2_alpha-2.159.0a0.dist-info/METADATA +391 -0
- aws_cdk.aws_ec2_alpha-2.159.0a0.dist-info/RECORD +10 -0
- aws_cdk/aws_ec2_alpha/_jsii/aws-ec2-alpha@2.158.0-alpha.0.jsii.tgz +0 -0
- aws_cdk.aws_ec2_alpha-2.158.0a0.dist-info/METADATA +0 -232
- aws_cdk.aws_ec2_alpha-2.158.0a0.dist-info/RECORD +0 -10
- {aws_cdk.aws_ec2_alpha-2.158.0a0.dist-info → aws_cdk.aws_ec2_alpha-2.159.0a0.dist-info}/LICENSE +0 -0
- {aws_cdk.aws_ec2_alpha-2.158.0a0.dist-info → aws_cdk.aws_ec2_alpha-2.159.0a0.dist-info}/NOTICE +0 -0
- {aws_cdk.aws_ec2_alpha-2.158.0a0.dist-info → aws_cdk.aws_ec2_alpha-2.159.0a0.dist-info}/WHEEL +0 -0
- {aws_cdk.aws_ec2_alpha-2.158.0a0.dist-info → aws_cdk.aws_ec2_alpha-2.159.0a0.dist-info}/top_level.txt +0 -0
|
@@ -25,10 +25,10 @@ To create a VPC with both IPv4 and IPv6 support:
|
|
|
25
25
|
|
|
26
26
|
```python
|
|
27
27
|
stack = Stack()
|
|
28
|
-
|
|
29
|
-
primary_address_block=
|
|
28
|
+
VpcV2(self, "Vpc",
|
|
29
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
30
30
|
secondary_address_blocks=[
|
|
31
|
-
|
|
31
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIpv6")
|
|
32
32
|
]
|
|
33
33
|
)
|
|
34
34
|
```
|
|
@@ -44,18 +44,18 @@ This new construct can be used to add subnets to a `VpcV2` instance:
|
|
|
44
44
|
|
|
45
45
|
```python
|
|
46
46
|
stack = Stack()
|
|
47
|
-
my_vpc =
|
|
47
|
+
my_vpc = VpcV2(self, "Vpc",
|
|
48
48
|
secondary_address_blocks=[
|
|
49
|
-
|
|
49
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIp")
|
|
50
50
|
]
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
SubnetV2(self, "subnetA",
|
|
54
54
|
vpc=my_vpc,
|
|
55
55
|
availability_zone="us-east-1a",
|
|
56
|
-
ipv4_cidr_block=
|
|
57
|
-
ipv6_cidr_block=
|
|
58
|
-
subnet_type=
|
|
56
|
+
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
57
|
+
ipv6_cidr_block=IpCidr("2a05:d02c:25:4000::/60"),
|
|
58
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
59
59
|
)
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -73,28 +73,28 @@ ipam = Ipam(self, "Ipam",
|
|
|
73
73
|
operating_region=["us-west-1"]
|
|
74
74
|
)
|
|
75
75
|
ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
|
|
76
|
-
address_family=
|
|
76
|
+
address_family=AddressFamily.IP_V6,
|
|
77
77
|
aws_service=AwsServiceName.EC2,
|
|
78
78
|
locale="us-west-1",
|
|
79
|
-
public_ip_source=
|
|
79
|
+
public_ip_source=IpamPoolPublicIpSource.AMAZON
|
|
80
80
|
)
|
|
81
81
|
ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
|
|
82
82
|
|
|
83
83
|
ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
|
|
84
|
-
address_family=
|
|
84
|
+
address_family=AddressFamily.IP_V4
|
|
85
85
|
)
|
|
86
86
|
ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
primary_address_block=
|
|
88
|
+
VpcV2(self, "Vpc",
|
|
89
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
90
90
|
secondary_address_blocks=[
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
|
|
92
|
+
IpAddresses.ipv6_ipam(
|
|
93
93
|
ipam_pool=ipam_public_pool,
|
|
94
94
|
netmask_length=52,
|
|
95
95
|
cidr_block_name="ipv6Ipam"
|
|
96
96
|
),
|
|
97
|
-
|
|
97
|
+
IpAddresses.ipv4_ipam(
|
|
98
98
|
ipam_pool=ipam_private_pool,
|
|
99
99
|
netmask_length=8,
|
|
100
100
|
cidr_block_name="ipv4Ipam"
|
|
@@ -110,65 +110,88 @@ Since `VpcV2` does not create subnets automatically, users have full control ove
|
|
|
110
110
|
`RouteTable` is a new construct that allows for route tables to be customized in a variety of ways. For instance, the following example shows how a custom route table can be created and appended to a subnet:
|
|
111
111
|
|
|
112
112
|
```python
|
|
113
|
-
my_vpc =
|
|
114
|
-
route_table =
|
|
113
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
114
|
+
route_table = RouteTable(self, "RouteTable",
|
|
115
115
|
vpc=my_vpc
|
|
116
116
|
)
|
|
117
|
-
subnet =
|
|
117
|
+
subnet = SubnetV2(self, "Subnet",
|
|
118
118
|
vpc=my_vpc,
|
|
119
119
|
route_table=route_table,
|
|
120
120
|
availability_zone="eu-west-2a",
|
|
121
121
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
122
|
-
subnet_type=
|
|
122
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
123
123
|
)
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
`
|
|
126
|
+
`Routes` can be created to link subnets to various different AWS services via gateways and endpoints. Each unique route target has its own dedicated construct that can be routed to a given subnet via the `Route` construct. An example using the `InternetGateway` construct can be seen below:
|
|
127
127
|
|
|
128
128
|
```python
|
|
129
129
|
stack = Stack()
|
|
130
|
-
my_vpc =
|
|
131
|
-
route_table =
|
|
130
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
131
|
+
route_table = RouteTable(self, "RouteTable",
|
|
132
132
|
vpc=my_vpc
|
|
133
133
|
)
|
|
134
|
-
subnet =
|
|
134
|
+
subnet = SubnetV2(self, "Subnet",
|
|
135
135
|
vpc=my_vpc,
|
|
136
136
|
availability_zone="eu-west-2a",
|
|
137
137
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
138
|
-
subnet_type=
|
|
138
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
139
139
|
)
|
|
140
140
|
|
|
141
|
-
igw =
|
|
141
|
+
igw = InternetGateway(self, "IGW",
|
|
142
142
|
vpc=my_vpc
|
|
143
143
|
)
|
|
144
|
-
|
|
144
|
+
Route(self, "IgwRoute",
|
|
145
145
|
route_table=route_table,
|
|
146
146
|
destination="0.0.0.0/0",
|
|
147
147
|
target={"gateway": igw}
|
|
148
148
|
)
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
+
Alternatively, `Routes` can also be created via method `addRoute` in the `RouteTable` class. An example using the `EgressOnlyInternetGateway` construct can be seen below:
|
|
152
|
+
Note: `EgressOnlyInternetGateway` can only be used to set up outbound IPv6 routing.
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
stack = Stack()
|
|
156
|
+
my_vpc = VpcV2(self, "Vpc",
|
|
157
|
+
primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
|
|
158
|
+
secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
|
|
159
|
+
cidr_block_name="AmazonProvided"
|
|
160
|
+
)]
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
eigw = EgressOnlyInternetGateway(self, "EIGW",
|
|
164
|
+
vpc=my_vpc
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
route_table = RouteTable(self, "RouteTable",
|
|
168
|
+
vpc=my_vpc
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
route_table.add_route("EIGW", "::/0", {"gateway": eigw})
|
|
172
|
+
```
|
|
173
|
+
|
|
151
174
|
Other route targets may require a deeper set of parameters to set up properly. For instance, the example below illustrates how to set up a `NatGateway`:
|
|
152
175
|
|
|
153
176
|
```python
|
|
154
|
-
my_vpc =
|
|
155
|
-
route_table =
|
|
177
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
178
|
+
route_table = RouteTable(self, "RouteTable",
|
|
156
179
|
vpc=my_vpc
|
|
157
180
|
)
|
|
158
|
-
subnet =
|
|
181
|
+
subnet = SubnetV2(self, "Subnet",
|
|
159
182
|
vpc=my_vpc,
|
|
160
183
|
availability_zone="eu-west-2a",
|
|
161
184
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
162
|
-
subnet_type=
|
|
185
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
163
186
|
)
|
|
164
187
|
|
|
165
|
-
natgw =
|
|
188
|
+
natgw = NatGateway(self, "NatGW",
|
|
166
189
|
subnet=subnet,
|
|
167
190
|
vpc=my_vpc,
|
|
168
191
|
connectivity_type=NatConnectivityType.PRIVATE,
|
|
169
192
|
private_ip_address="10.0.0.42"
|
|
170
193
|
)
|
|
171
|
-
|
|
194
|
+
Route(self, "NatGwRoute",
|
|
172
195
|
route_table=route_table,
|
|
173
196
|
destination="0.0.0.0/0",
|
|
174
197
|
target={"gateway": natgw}
|
|
@@ -178,15 +201,16 @@ vpc_v2.Route(self, "NatGwRoute",
|
|
|
178
201
|
It is also possible to set up endpoints connecting other AWS services. For instance, the example below illustrates the linking of a Dynamo DB endpoint via the existing `ec2.GatewayVpcEndpoint` construct as a route target:
|
|
179
202
|
|
|
180
203
|
```python
|
|
181
|
-
|
|
182
|
-
|
|
204
|
+
stack = Stack()
|
|
205
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
206
|
+
route_table = RouteTable(self, "RouteTable",
|
|
183
207
|
vpc=my_vpc
|
|
184
208
|
)
|
|
185
|
-
subnet =
|
|
209
|
+
subnet = SubnetV2(self, "Subnet",
|
|
186
210
|
vpc=my_vpc,
|
|
187
211
|
availability_zone="eu-west-2a",
|
|
188
212
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
189
|
-
subnet_type=
|
|
213
|
+
subnet_type=SubnetType.PRIVATE
|
|
190
214
|
)
|
|
191
215
|
|
|
192
216
|
dynamo_endpoint = ec2.GatewayVpcEndpoint(self, "DynamoEndpoint",
|
|
@@ -194,12 +218,147 @@ dynamo_endpoint = ec2.GatewayVpcEndpoint(self, "DynamoEndpoint",
|
|
|
194
218
|
vpc=my_vpc,
|
|
195
219
|
subnets=[subnet]
|
|
196
220
|
)
|
|
197
|
-
|
|
221
|
+
Route(self, "DynamoDBRoute",
|
|
198
222
|
route_table=route_table,
|
|
199
223
|
destination="0.0.0.0/0",
|
|
200
224
|
target={"endpoint": dynamo_endpoint}
|
|
201
225
|
)
|
|
202
226
|
```
|
|
227
|
+
|
|
228
|
+
## Adding Egress-Only Internet Gateway to VPC
|
|
229
|
+
|
|
230
|
+
An egress-only internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows outbound communication over IPv6 from instances in your VPC to the internet, and prevents the internet from initiating an IPv6 connection with your instances.
|
|
231
|
+
|
|
232
|
+
For more information see [Enable outbound IPv6 traffic using an egress-only internet gateway](https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway.html).
|
|
233
|
+
|
|
234
|
+
VpcV2 supports adding an egress only internet gateway to VPC using the `addEgressOnlyInternetGateway` method.
|
|
235
|
+
|
|
236
|
+
By default, this method sets up a route to all outbound IPv6 address ranges, unless a specific destination is provided by the user. It can only be configured for IPv6-enabled VPCs.
|
|
237
|
+
The `Subnets` parameter accepts a `SubnetFilter`, which can be based on a `SubnetType` in VpcV2. A new route will be added to the route tables of all subnets that match this filter.
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
stack = Stack()
|
|
241
|
+
my_vpc = VpcV2(self, "Vpc",
|
|
242
|
+
primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
|
|
243
|
+
secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
|
|
244
|
+
cidr_block_name="AmazonProvided"
|
|
245
|
+
)]
|
|
246
|
+
)
|
|
247
|
+
route_table = RouteTable(self, "RouteTable",
|
|
248
|
+
vpc=my_vpc
|
|
249
|
+
)
|
|
250
|
+
subnet = SubnetV2(self, "Subnet",
|
|
251
|
+
vpc=my_vpc,
|
|
252
|
+
availability_zone="eu-west-2a",
|
|
253
|
+
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
254
|
+
ipv6_cidr_block=IpCidr("2001:db8:1::/64"),
|
|
255
|
+
subnet_type=SubnetType.PRIVATE
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
my_vpc.add_egress_only_internet_gateway(
|
|
259
|
+
subnets=[ec2.SubnetSelection(subnet_type=SubnetType.PRIVATE)],
|
|
260
|
+
destination="::/60"
|
|
261
|
+
)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Adding NATGateway to the VPC
|
|
265
|
+
|
|
266
|
+
A NAT gateway is a Network Address Translation (NAT) service.You can use a NAT gateway so that instances in a private subnet can connect to services outside your VPC but external services cannot initiate a connection with those instances.
|
|
267
|
+
|
|
268
|
+
For more information, see [NAT gateway basics](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html).
|
|
269
|
+
|
|
270
|
+
When you create a NAT gateway, you specify one of the following connectivity types:
|
|
271
|
+
|
|
272
|
+
**Public – (Default)**: Instances in private subnets can connect to the internet through a public NAT gateway, but cannot receive unsolicited inbound connections from the internet
|
|
273
|
+
|
|
274
|
+
**Private**: Instances in private subnets can connect to other VPCs or your on-premises network through a private NAT gateway.
|
|
275
|
+
|
|
276
|
+
To define the NAT gateway connectivity type as `ConnectivityType.Public`, you need to ensure that there is an IGW(Internet Gateway) attached to the subnet's VPC.
|
|
277
|
+
Since a NATGW is associated with a particular subnet, providing `subnet` field in the input props is mandatory.
|
|
278
|
+
|
|
279
|
+
Additionally, you can set up a route in any route table with the target set to the NAT Gateway. The function `addNatGateway` returns a `NATGateway` object that you can reference later.
|
|
280
|
+
|
|
281
|
+
The code example below provides the definition for adding a NAT gateway to your subnet:
|
|
282
|
+
|
|
283
|
+
```python
|
|
284
|
+
stack = Stack()
|
|
285
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
286
|
+
route_table = RouteTable(self, "RouteTable",
|
|
287
|
+
vpc=my_vpc
|
|
288
|
+
)
|
|
289
|
+
subnet = SubnetV2(self, "Subnet",
|
|
290
|
+
vpc=my_vpc,
|
|
291
|
+
availability_zone="eu-west-2a",
|
|
292
|
+
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
293
|
+
subnet_type=SubnetType.PUBLIC
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
my_vpc.add_internet_gateway()
|
|
297
|
+
my_vpc.add_nat_gateway(
|
|
298
|
+
subnet=subnet,
|
|
299
|
+
connectivity_type=NatConnectivityType.PUBLIC
|
|
300
|
+
)
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Enable VPNGateway for the VPC
|
|
304
|
+
|
|
305
|
+
A virtual private gateway is the endpoint on the VPC side of your VPN connection.
|
|
306
|
+
|
|
307
|
+
For more information, see [What is AWS Site-to-Site VPN?](https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html).
|
|
308
|
+
|
|
309
|
+
VPN route propagation is a feature in Amazon Web Services (AWS) that automatically updates route tables in your Virtual Private Cloud (VPC) with routes learned from a VPN connection.
|
|
310
|
+
|
|
311
|
+
To enable VPN route propogation, use the `vpnRoutePropagation` property to specify the subnets as an input to the function. VPN route propagation will then be enabled for each subnet with the corresponding route table IDs.
|
|
312
|
+
|
|
313
|
+
Additionally, you can set up a route in any route table with the target set to the VPN Gateway. The function `enableVpnGatewayV2` returns a `VPNGatewayV2` object that you can reference later.
|
|
314
|
+
|
|
315
|
+
The code example below provides the definition for setting up a VPN gateway with `vpnRoutePropogation` enabled:
|
|
316
|
+
|
|
317
|
+
```python
|
|
318
|
+
stack = Stack()
|
|
319
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
320
|
+
vpn_gateway = my_vpc.enable_vpn_gateway_v2(
|
|
321
|
+
vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
|
|
322
|
+
type=VpnConnectionType.IPSEC_1
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
route_table = RouteTable(stack, "routeTable",
|
|
326
|
+
vpc=my_vpc
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
Route(stack, "route",
|
|
330
|
+
destination="172.31.0.0/24",
|
|
331
|
+
target={"gateway": vpn_gateway},
|
|
332
|
+
route_table=route_table
|
|
333
|
+
)
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## Adding InternetGateway to the VPC
|
|
337
|
+
|
|
338
|
+
An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet. It supports both IPv4 and IPv6 traffic.
|
|
339
|
+
|
|
340
|
+
For more information, see [Enable VPC internet access using internet gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-igw-internet-access.html).
|
|
341
|
+
|
|
342
|
+
You can add an internet gateway to a VPC using `addInternetGateway` method. By default, this method creates a route in all Public Subnets with outbound destination set to `0.0.0.0` for IPv4 and `::0` for IPv6 enabled VPC.
|
|
343
|
+
Instead of using the default settings, you can configure a custom destinatation range by providing an optional input `destination` to the method.
|
|
344
|
+
|
|
345
|
+
The code example below shows how to add an internet gateway with a custom outbound destination IP range:
|
|
346
|
+
|
|
347
|
+
```python
|
|
348
|
+
stack = Stack()
|
|
349
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
350
|
+
|
|
351
|
+
subnet = SubnetV2(self, "Subnet",
|
|
352
|
+
vpc=my_vpc,
|
|
353
|
+
availability_zone="eu-west-2a",
|
|
354
|
+
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
355
|
+
subnet_type=SubnetType.PUBLIC
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
my_vpc.add_internet_gateway(
|
|
359
|
+
ipv4_destination="192.168.0.0/16"
|
|
360
|
+
)
|
|
361
|
+
```
|
|
203
362
|
'''
|
|
204
363
|
from pkgutil import extend_path
|
|
205
364
|
__path__ = extend_path(__path__, __name__)
|
|
@@ -257,28 +416,28 @@ class AddressFamily(enum.Enum):
|
|
|
257
416
|
operating_region=["us-west-1"]
|
|
258
417
|
)
|
|
259
418
|
ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
|
|
260
|
-
address_family=
|
|
419
|
+
address_family=AddressFamily.IP_V6,
|
|
261
420
|
aws_service=AwsServiceName.EC2,
|
|
262
421
|
locale="us-west-1",
|
|
263
|
-
public_ip_source=
|
|
422
|
+
public_ip_source=IpamPoolPublicIpSource.AMAZON
|
|
264
423
|
)
|
|
265
424
|
ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
|
|
266
425
|
|
|
267
426
|
ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
|
|
268
|
-
address_family=
|
|
427
|
+
address_family=AddressFamily.IP_V4
|
|
269
428
|
)
|
|
270
429
|
ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
|
|
271
430
|
|
|
272
|
-
|
|
273
|
-
primary_address_block=
|
|
431
|
+
VpcV2(self, "Vpc",
|
|
432
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
274
433
|
secondary_address_blocks=[
|
|
275
|
-
|
|
276
|
-
|
|
434
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
|
|
435
|
+
IpAddresses.ipv6_ipam(
|
|
277
436
|
ipam_pool=ipam_public_pool,
|
|
278
437
|
netmask_length=52,
|
|
279
438
|
cidr_block_name="ipv6Ipam"
|
|
280
439
|
),
|
|
281
|
-
|
|
440
|
+
IpAddresses.ipv4_ipam(
|
|
282
441
|
ipam_pool=ipam_private_pool,
|
|
283
442
|
netmask_length=8,
|
|
284
443
|
cidr_block_name="ipv4Ipam"
|
|
@@ -317,6 +476,97 @@ class AwsServiceName(enum.Enum):
|
|
|
317
476
|
'''
|
|
318
477
|
|
|
319
478
|
|
|
479
|
+
@jsii.data_type(
|
|
480
|
+
jsii_type="@aws-cdk/aws-ec2-alpha.EgressOnlyInternetGatewayOptions",
|
|
481
|
+
jsii_struct_bases=[],
|
|
482
|
+
name_mapping={"destination": "destination", "subnets": "subnets"},
|
|
483
|
+
)
|
|
484
|
+
class EgressOnlyInternetGatewayOptions:
|
|
485
|
+
def __init__(
|
|
486
|
+
self,
|
|
487
|
+
*,
|
|
488
|
+
destination: typing.Optional[builtins.str] = None,
|
|
489
|
+
subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
490
|
+
) -> None:
|
|
491
|
+
'''(experimental) Options to define EgressOnlyInternetGateway for VPC.
|
|
492
|
+
|
|
493
|
+
:param destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
|
|
494
|
+
:param subnets: (experimental) List of subnets where route to EGW will be added. Default: - no route created
|
|
495
|
+
|
|
496
|
+
:stability: experimental
|
|
497
|
+
:exampleMetadata: infused
|
|
498
|
+
|
|
499
|
+
Example::
|
|
500
|
+
|
|
501
|
+
stack = Stack()
|
|
502
|
+
my_vpc = VpcV2(self, "Vpc",
|
|
503
|
+
primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
|
|
504
|
+
secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
|
|
505
|
+
cidr_block_name="AmazonProvided"
|
|
506
|
+
)]
|
|
507
|
+
)
|
|
508
|
+
route_table = RouteTable(self, "RouteTable",
|
|
509
|
+
vpc=my_vpc
|
|
510
|
+
)
|
|
511
|
+
subnet = SubnetV2(self, "Subnet",
|
|
512
|
+
vpc=my_vpc,
|
|
513
|
+
availability_zone="eu-west-2a",
|
|
514
|
+
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
515
|
+
ipv6_cidr_block=IpCidr("2001:db8:1::/64"),
|
|
516
|
+
subnet_type=SubnetType.PRIVATE
|
|
517
|
+
)
|
|
518
|
+
|
|
519
|
+
my_vpc.add_egress_only_internet_gateway(
|
|
520
|
+
subnets=[ec2.SubnetSelection(subnet_type=SubnetType.PRIVATE)],
|
|
521
|
+
destination="::/60"
|
|
522
|
+
)
|
|
523
|
+
'''
|
|
524
|
+
if __debug__:
|
|
525
|
+
type_hints = typing.get_type_hints(_typecheckingstub__47cf639398ded64820e35dac43908a70a34ddc76a3ed35cc0c24357b0e01f48d)
|
|
526
|
+
check_type(argname="argument destination", value=destination, expected_type=type_hints["destination"])
|
|
527
|
+
check_type(argname="argument subnets", value=subnets, expected_type=type_hints["subnets"])
|
|
528
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
529
|
+
if destination is not None:
|
|
530
|
+
self._values["destination"] = destination
|
|
531
|
+
if subnets is not None:
|
|
532
|
+
self._values["subnets"] = subnets
|
|
533
|
+
|
|
534
|
+
@builtins.property
|
|
535
|
+
def destination(self) -> typing.Optional[builtins.str]:
|
|
536
|
+
'''(experimental) Destination Ipv6 address for EGW route.
|
|
537
|
+
|
|
538
|
+
:default: - '::/0' all Ipv6 traffic
|
|
539
|
+
|
|
540
|
+
:stability: experimental
|
|
541
|
+
'''
|
|
542
|
+
result = self._values.get("destination")
|
|
543
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
544
|
+
|
|
545
|
+
@builtins.property
|
|
546
|
+
def subnets(
|
|
547
|
+
self,
|
|
548
|
+
) -> typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]]:
|
|
549
|
+
'''(experimental) List of subnets where route to EGW will be added.
|
|
550
|
+
|
|
551
|
+
:default: - no route created
|
|
552
|
+
|
|
553
|
+
:stability: experimental
|
|
554
|
+
'''
|
|
555
|
+
result = self._values.get("subnets")
|
|
556
|
+
return typing.cast(typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]], result)
|
|
557
|
+
|
|
558
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
559
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
560
|
+
|
|
561
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
562
|
+
return not (rhs == self)
|
|
563
|
+
|
|
564
|
+
def __repr__(self) -> str:
|
|
565
|
+
return "EgressOnlyInternetGatewayOptions(%s)" % ", ".join(
|
|
566
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
567
|
+
)
|
|
568
|
+
|
|
569
|
+
|
|
320
570
|
@jsii.data_type(
|
|
321
571
|
jsii_type="@aws-cdk/aws-ec2-alpha.EgressOnlyInternetGatewayProps",
|
|
322
572
|
jsii_struct_bases=[],
|
|
@@ -335,25 +585,30 @@ class EgressOnlyInternetGatewayProps:
|
|
|
335
585
|
'''(experimental) Properties to define an egress-only internet gateway.
|
|
336
586
|
|
|
337
587
|
:param vpc: (experimental) The ID of the VPC for which to create the egress-only internet gateway.
|
|
338
|
-
:param egress_only_internet_gateway_name: (experimental) The resource name of the egress-only internet gateway. Default:
|
|
588
|
+
:param egress_only_internet_gateway_name: (experimental) The resource name of the egress-only internet gateway. Default: - provisioned without a resource name
|
|
339
589
|
|
|
340
590
|
:stability: experimental
|
|
341
|
-
:exampleMetadata:
|
|
591
|
+
:exampleMetadata: infused
|
|
342
592
|
|
|
343
593
|
Example::
|
|
344
594
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
595
|
+
stack = Stack()
|
|
596
|
+
my_vpc = VpcV2(self, "Vpc",
|
|
597
|
+
primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
|
|
598
|
+
secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
|
|
599
|
+
cidr_block_name="AmazonProvided"
|
|
600
|
+
)]
|
|
601
|
+
)
|
|
350
602
|
|
|
351
|
-
|
|
352
|
-
vpc=
|
|
603
|
+
eigw = EgressOnlyInternetGateway(self, "EIGW",
|
|
604
|
+
vpc=my_vpc
|
|
605
|
+
)
|
|
353
606
|
|
|
354
|
-
|
|
355
|
-
|
|
607
|
+
route_table = RouteTable(self, "RouteTable",
|
|
608
|
+
vpc=my_vpc
|
|
356
609
|
)
|
|
610
|
+
|
|
611
|
+
route_table.add_route("EIGW", "::/0", {"gateway": eigw})
|
|
357
612
|
'''
|
|
358
613
|
if __debug__:
|
|
359
614
|
type_hints = typing.get_type_hints(_typecheckingstub__a1cb0281052a85d3461453c956e87b81e82be05002c1ac33451b382cfcf0ea7e)
|
|
@@ -379,7 +634,7 @@ class EgressOnlyInternetGatewayProps:
|
|
|
379
634
|
def egress_only_internet_gateway_name(self) -> typing.Optional[builtins.str]:
|
|
380
635
|
'''(experimental) The resource name of the egress-only internet gateway.
|
|
381
636
|
|
|
382
|
-
:default:
|
|
637
|
+
:default: - provisioned without a resource name
|
|
383
638
|
|
|
384
639
|
:stability: experimental
|
|
385
640
|
'''
|
|
@@ -471,8 +726,8 @@ class IIpamPool(typing_extensions.Protocol):
|
|
|
471
726
|
'''(experimental) Function to associate a IPv6 address with IPAM pool.
|
|
472
727
|
|
|
473
728
|
:param id: -
|
|
474
|
-
:param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default:
|
|
475
|
-
:param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default:
|
|
729
|
+
:param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: - pool provisioned without netmask length, need netmask length in this case
|
|
730
|
+
:param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: - pool provisioned without netmask length, need cidr range in this case
|
|
476
731
|
|
|
477
732
|
:stability: experimental
|
|
478
733
|
'''
|
|
@@ -517,8 +772,8 @@ class _IIpamPoolProxy:
|
|
|
517
772
|
'''(experimental) Function to associate a IPv6 address with IPAM pool.
|
|
518
773
|
|
|
519
774
|
:param id: -
|
|
520
|
-
:param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default:
|
|
521
|
-
:param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default:
|
|
775
|
+
:param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: - pool provisioned without netmask length, need netmask length in this case
|
|
776
|
+
:param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: - pool provisioned without netmask length, need cidr range in this case
|
|
522
777
|
|
|
523
778
|
:stability: experimental
|
|
524
779
|
'''
|
|
@@ -584,9 +839,9 @@ class IIpamScopeBase(typing_extensions.Protocol):
|
|
|
584
839
|
|
|
585
840
|
:param id: -
|
|
586
841
|
:param address_family: (experimental) addressFamily - The address family of the pool (ipv4 or ipv6).
|
|
587
|
-
:param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: -
|
|
842
|
+
:param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - required in case of an IPv6, throws an error if not provided.
|
|
588
843
|
:param ipv4_provisioned_cidrs: (experimental) Information about the CIDRs provisioned to the pool. Default: - No CIDRs are provisioned
|
|
589
|
-
:param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region
|
|
844
|
+
:param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region of IPAM
|
|
590
845
|
:param public_ip_source: (experimental) The IP address source for pools in the public scope. Only used for IPv6 address Only allowed values to this are 'byoip' or 'amazon' Default: amazon
|
|
591
846
|
|
|
592
847
|
:stability: experimental
|
|
@@ -644,9 +899,9 @@ class _IIpamScopeBaseProxy:
|
|
|
644
899
|
|
|
645
900
|
:param id: -
|
|
646
901
|
:param address_family: (experimental) addressFamily - The address family of the pool (ipv4 or ipv6).
|
|
647
|
-
:param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: -
|
|
902
|
+
:param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - required in case of an IPv6, throws an error if not provided.
|
|
648
903
|
:param ipv4_provisioned_cidrs: (experimental) Information about the CIDRs provisioned to the pool. Default: - No CIDRs are provisioned
|
|
649
|
-
:param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region
|
|
904
|
+
:param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region of IPAM
|
|
650
905
|
:param public_ip_source: (experimental) The IP address source for pools in the public scope. Only used for IPv6 address Only allowed values to this are 'byoip' or 'amazon' Default: amazon
|
|
651
906
|
|
|
652
907
|
:stability: experimental
|
|
@@ -669,7 +924,7 @@ typing.cast(typing.Any, IIpamScopeBase).__jsii_proxy_class__ = lambda : _IIpamSc
|
|
|
669
924
|
|
|
670
925
|
|
|
671
926
|
@jsii.interface(jsii_type="@aws-cdk/aws-ec2-alpha.IRouteTarget")
|
|
672
|
-
class IRouteTarget(typing_extensions.Protocol):
|
|
927
|
+
class IRouteTarget(_constructs_77d1e7e8.IDependable, typing_extensions.Protocol):
|
|
673
928
|
'''(experimental) Interface to define a routing target, such as an egress-only internet gateway or VPC endpoint.
|
|
674
929
|
|
|
675
930
|
:stability: experimental
|
|
@@ -694,7 +949,9 @@ class IRouteTarget(typing_extensions.Protocol):
|
|
|
694
949
|
...
|
|
695
950
|
|
|
696
951
|
|
|
697
|
-
class _IRouteTargetProxy
|
|
952
|
+
class _IRouteTargetProxy(
|
|
953
|
+
jsii.proxy_for(_constructs_77d1e7e8.IDependable), # type: ignore[misc]
|
|
954
|
+
):
|
|
698
955
|
'''(experimental) Interface to define a routing target, such as an egress-only internet gateway or VPC endpoint.
|
|
699
956
|
|
|
700
957
|
:stability: experimental
|
|
@@ -725,7 +982,7 @@ typing.cast(typing.Any, IRouteTarget).__jsii_proxy_class__ = lambda : _IRouteTar
|
|
|
725
982
|
|
|
726
983
|
|
|
727
984
|
@jsii.interface(jsii_type="@aws-cdk/aws-ec2-alpha.IRouteV2")
|
|
728
|
-
class IRouteV2(typing_extensions.Protocol):
|
|
985
|
+
class IRouteV2(_aws_cdk_ceddda9d.IResource, typing_extensions.Protocol):
|
|
729
986
|
'''(experimental) Interface to define a route.
|
|
730
987
|
|
|
731
988
|
:stability: experimental
|
|
@@ -763,7 +1020,9 @@ class IRouteV2(typing_extensions.Protocol):
|
|
|
763
1020
|
...
|
|
764
1021
|
|
|
765
1022
|
|
|
766
|
-
class _IRouteV2Proxy
|
|
1023
|
+
class _IRouteV2Proxy(
|
|
1024
|
+
jsii.proxy_for(_aws_cdk_ceddda9d.IResource), # type: ignore[misc]
|
|
1025
|
+
):
|
|
767
1026
|
'''(experimental) Interface to define a route.
|
|
768
1027
|
|
|
769
1028
|
:stability: experimental
|
|
@@ -822,6 +1081,16 @@ class ISubnetV2(_aws_cdk_aws_ec2_ceddda9d.ISubnet, typing_extensions.Protocol):
|
|
|
822
1081
|
'''
|
|
823
1082
|
...
|
|
824
1083
|
|
|
1084
|
+
@builtins.property
|
|
1085
|
+
@jsii.member(jsii_name="subnetType")
|
|
1086
|
+
def subnet_type(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType]:
|
|
1087
|
+
'''(experimental) The type of subnet (public or private) that this subnet represents.
|
|
1088
|
+
|
|
1089
|
+
:stability: experimental
|
|
1090
|
+
:attribute: SubnetType
|
|
1091
|
+
'''
|
|
1092
|
+
...
|
|
1093
|
+
|
|
825
1094
|
|
|
826
1095
|
class _ISubnetV2Proxy(
|
|
827
1096
|
jsii.proxy_for(_aws_cdk_aws_ec2_ceddda9d.ISubnet), # type: ignore[misc]
|
|
@@ -842,6 +1111,16 @@ class _ISubnetV2Proxy(
|
|
|
842
1111
|
'''
|
|
843
1112
|
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "ipv6CidrBlock"))
|
|
844
1113
|
|
|
1114
|
+
@builtins.property
|
|
1115
|
+
@jsii.member(jsii_name="subnetType")
|
|
1116
|
+
def subnet_type(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType]:
|
|
1117
|
+
'''(experimental) The type of subnet (public or private) that this subnet represents.
|
|
1118
|
+
|
|
1119
|
+
:stability: experimental
|
|
1120
|
+
:attribute: SubnetType
|
|
1121
|
+
'''
|
|
1122
|
+
return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType], jsii.get(self, "subnetType"))
|
|
1123
|
+
|
|
845
1124
|
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
846
1125
|
typing.cast(typing.Any, ISubnetV2).__jsii_proxy_class__ = lambda : _ISubnetV2Proxy
|
|
847
1126
|
|
|
@@ -879,6 +1158,104 @@ class IVpcV2(_aws_cdk_aws_ec2_ceddda9d.IVpc, typing_extensions.Protocol):
|
|
|
879
1158
|
'''
|
|
880
1159
|
...
|
|
881
1160
|
|
|
1161
|
+
@jsii.member(jsii_name="addEgressOnlyInternetGateway")
|
|
1162
|
+
def add_egress_only_internet_gateway(
|
|
1163
|
+
self,
|
|
1164
|
+
*,
|
|
1165
|
+
destination: typing.Optional[builtins.str] = None,
|
|
1166
|
+
subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1167
|
+
) -> None:
|
|
1168
|
+
'''(experimental) Add an Egress only Internet Gateway to current VPC.
|
|
1169
|
+
|
|
1170
|
+
Can only be used for ipv6 enabled VPCs.
|
|
1171
|
+
For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway-basics.html}.
|
|
1172
|
+
|
|
1173
|
+
:param destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
|
|
1174
|
+
:param subnets: (experimental) List of subnets where route to EGW will be added. Default: - no route created
|
|
1175
|
+
|
|
1176
|
+
:stability: experimental
|
|
1177
|
+
'''
|
|
1178
|
+
...
|
|
1179
|
+
|
|
1180
|
+
@jsii.member(jsii_name="addInternetGateway")
|
|
1181
|
+
def add_internet_gateway(
|
|
1182
|
+
self,
|
|
1183
|
+
*,
|
|
1184
|
+
ipv4_destination: typing.Optional[builtins.str] = None,
|
|
1185
|
+
ipv6_destination: typing.Optional[builtins.str] = None,
|
|
1186
|
+
) -> None:
|
|
1187
|
+
'''(experimental) Adds an Internet Gateway to current VPC.
|
|
1188
|
+
|
|
1189
|
+
For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-igw-internet-access.html}.
|
|
1190
|
+
|
|
1191
|
+
:param ipv4_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '0.0.0.0' all Ipv4 traffic
|
|
1192
|
+
:param ipv6_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
|
|
1193
|
+
|
|
1194
|
+
:default: - defines route for all ipv4('0.0.0.0') and ipv6 addresses('::/0')
|
|
1195
|
+
|
|
1196
|
+
:stability: experimental
|
|
1197
|
+
'''
|
|
1198
|
+
...
|
|
1199
|
+
|
|
1200
|
+
@jsii.member(jsii_name="addNatGateway")
|
|
1201
|
+
def add_nat_gateway(
|
|
1202
|
+
self,
|
|
1203
|
+
*,
|
|
1204
|
+
subnet: ISubnetV2,
|
|
1205
|
+
allocation_id: typing.Optional[builtins.str] = None,
|
|
1206
|
+
connectivity_type: typing.Optional["NatConnectivityType"] = None,
|
|
1207
|
+
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
1208
|
+
nat_gateway_name: typing.Optional[builtins.str] = None,
|
|
1209
|
+
private_ip_address: typing.Optional[builtins.str] = None,
|
|
1210
|
+
secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
1211
|
+
secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
|
|
1212
|
+
secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
1213
|
+
) -> "NatGateway":
|
|
1214
|
+
'''(experimental) Adds a new NAT Gateway to VPC A NAT gateway is a Network Address Translation (NAT) service.
|
|
1215
|
+
|
|
1216
|
+
NAT Gateway Connectivity can be of type ``Public`` or ``Private``.
|
|
1217
|
+
For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html}.
|
|
1218
|
+
|
|
1219
|
+
:param subnet: (experimental) The subnet in which the NAT gateway is located.
|
|
1220
|
+
:param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
|
|
1221
|
+
:param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
|
|
1222
|
+
:param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
|
|
1223
|
+
:param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
|
|
1224
|
+
:param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
1225
|
+
:param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
|
|
1226
|
+
:param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
|
|
1227
|
+
:param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
|
|
1228
|
+
|
|
1229
|
+
:default: ConnectivityType.Public
|
|
1230
|
+
|
|
1231
|
+
:stability: experimental
|
|
1232
|
+
'''
|
|
1233
|
+
...
|
|
1234
|
+
|
|
1235
|
+
@jsii.member(jsii_name="enableVpnGatewayV2")
|
|
1236
|
+
def enable_vpn_gateway_v2(
|
|
1237
|
+
self,
|
|
1238
|
+
*,
|
|
1239
|
+
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
1240
|
+
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
1241
|
+
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
1242
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1243
|
+
) -> "VPNGatewayV2":
|
|
1244
|
+
'''(experimental) Adds VPN Gateway to VPC and set route propogation.
|
|
1245
|
+
|
|
1246
|
+
For more information, see the {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpngateway.html}.
|
|
1247
|
+
|
|
1248
|
+
:param type: (experimental) The type of VPN connection the virtual private gateway supports.
|
|
1249
|
+
:param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
|
|
1250
|
+
:param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
|
|
1251
|
+
:param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
|
|
1252
|
+
|
|
1253
|
+
:default: - no route propogation
|
|
1254
|
+
|
|
1255
|
+
:stability: experimental
|
|
1256
|
+
'''
|
|
1257
|
+
...
|
|
1258
|
+
|
|
882
1259
|
|
|
883
1260
|
class _IVpcV2Proxy(
|
|
884
1261
|
jsii.proxy_for(_aws_cdk_aws_ec2_ceddda9d.IVpc), # type: ignore[misc]
|
|
@@ -910,11 +1287,136 @@ class _IVpcV2Proxy(
|
|
|
910
1287
|
) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock]:
|
|
911
1288
|
'''(experimental) The secondary CIDR blocks associated with the VPC.
|
|
912
1289
|
|
|
913
|
-
For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
|
|
1290
|
+
For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
|
|
1291
|
+
|
|
1292
|
+
:stability: experimental
|
|
1293
|
+
'''
|
|
1294
|
+
return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock], jsii.get(self, "secondaryCidrBlock"))
|
|
1295
|
+
|
|
1296
|
+
@jsii.member(jsii_name="addEgressOnlyInternetGateway")
|
|
1297
|
+
def add_egress_only_internet_gateway(
|
|
1298
|
+
self,
|
|
1299
|
+
*,
|
|
1300
|
+
destination: typing.Optional[builtins.str] = None,
|
|
1301
|
+
subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1302
|
+
) -> None:
|
|
1303
|
+
'''(experimental) Add an Egress only Internet Gateway to current VPC.
|
|
1304
|
+
|
|
1305
|
+
Can only be used for ipv6 enabled VPCs.
|
|
1306
|
+
For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway-basics.html}.
|
|
1307
|
+
|
|
1308
|
+
:param destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
|
|
1309
|
+
:param subnets: (experimental) List of subnets where route to EGW will be added. Default: - no route created
|
|
1310
|
+
|
|
1311
|
+
:stability: experimental
|
|
1312
|
+
'''
|
|
1313
|
+
options = EgressOnlyInternetGatewayOptions(
|
|
1314
|
+
destination=destination, subnets=subnets
|
|
1315
|
+
)
|
|
1316
|
+
|
|
1317
|
+
return typing.cast(None, jsii.invoke(self, "addEgressOnlyInternetGateway", [options]))
|
|
1318
|
+
|
|
1319
|
+
@jsii.member(jsii_name="addInternetGateway")
|
|
1320
|
+
def add_internet_gateway(
|
|
1321
|
+
self,
|
|
1322
|
+
*,
|
|
1323
|
+
ipv4_destination: typing.Optional[builtins.str] = None,
|
|
1324
|
+
ipv6_destination: typing.Optional[builtins.str] = None,
|
|
1325
|
+
) -> None:
|
|
1326
|
+
'''(experimental) Adds an Internet Gateway to current VPC.
|
|
1327
|
+
|
|
1328
|
+
For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-igw-internet-access.html}.
|
|
1329
|
+
|
|
1330
|
+
:param ipv4_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '0.0.0.0' all Ipv4 traffic
|
|
1331
|
+
:param ipv6_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
|
|
1332
|
+
|
|
1333
|
+
:default: - defines route for all ipv4('0.0.0.0') and ipv6 addresses('::/0')
|
|
1334
|
+
|
|
1335
|
+
:stability: experimental
|
|
1336
|
+
'''
|
|
1337
|
+
options = InternetGatewayOptions(
|
|
1338
|
+
ipv4_destination=ipv4_destination, ipv6_destination=ipv6_destination
|
|
1339
|
+
)
|
|
1340
|
+
|
|
1341
|
+
return typing.cast(None, jsii.invoke(self, "addInternetGateway", [options]))
|
|
1342
|
+
|
|
1343
|
+
@jsii.member(jsii_name="addNatGateway")
|
|
1344
|
+
def add_nat_gateway(
|
|
1345
|
+
self,
|
|
1346
|
+
*,
|
|
1347
|
+
subnet: ISubnetV2,
|
|
1348
|
+
allocation_id: typing.Optional[builtins.str] = None,
|
|
1349
|
+
connectivity_type: typing.Optional["NatConnectivityType"] = None,
|
|
1350
|
+
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
1351
|
+
nat_gateway_name: typing.Optional[builtins.str] = None,
|
|
1352
|
+
private_ip_address: typing.Optional[builtins.str] = None,
|
|
1353
|
+
secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
1354
|
+
secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
|
|
1355
|
+
secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
1356
|
+
) -> "NatGateway":
|
|
1357
|
+
'''(experimental) Adds a new NAT Gateway to VPC A NAT gateway is a Network Address Translation (NAT) service.
|
|
1358
|
+
|
|
1359
|
+
NAT Gateway Connectivity can be of type ``Public`` or ``Private``.
|
|
1360
|
+
For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html}.
|
|
1361
|
+
|
|
1362
|
+
:param subnet: (experimental) The subnet in which the NAT gateway is located.
|
|
1363
|
+
:param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
|
|
1364
|
+
:param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
|
|
1365
|
+
:param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
|
|
1366
|
+
:param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
|
|
1367
|
+
:param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
1368
|
+
:param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
|
|
1369
|
+
:param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
|
|
1370
|
+
:param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
|
|
1371
|
+
|
|
1372
|
+
:default: ConnectivityType.Public
|
|
1373
|
+
|
|
1374
|
+
:stability: experimental
|
|
1375
|
+
'''
|
|
1376
|
+
options = NatGatewayOptions(
|
|
1377
|
+
subnet=subnet,
|
|
1378
|
+
allocation_id=allocation_id,
|
|
1379
|
+
connectivity_type=connectivity_type,
|
|
1380
|
+
max_drain_duration=max_drain_duration,
|
|
1381
|
+
nat_gateway_name=nat_gateway_name,
|
|
1382
|
+
private_ip_address=private_ip_address,
|
|
1383
|
+
secondary_allocation_ids=secondary_allocation_ids,
|
|
1384
|
+
secondary_private_ip_address_count=secondary_private_ip_address_count,
|
|
1385
|
+
secondary_private_ip_addresses=secondary_private_ip_addresses,
|
|
1386
|
+
)
|
|
1387
|
+
|
|
1388
|
+
return typing.cast("NatGateway", jsii.invoke(self, "addNatGateway", [options]))
|
|
1389
|
+
|
|
1390
|
+
@jsii.member(jsii_name="enableVpnGatewayV2")
|
|
1391
|
+
def enable_vpn_gateway_v2(
|
|
1392
|
+
self,
|
|
1393
|
+
*,
|
|
1394
|
+
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
1395
|
+
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
1396
|
+
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
1397
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1398
|
+
) -> "VPNGatewayV2":
|
|
1399
|
+
'''(experimental) Adds VPN Gateway to VPC and set route propogation.
|
|
1400
|
+
|
|
1401
|
+
For more information, see the {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpngateway.html}.
|
|
1402
|
+
|
|
1403
|
+
:param type: (experimental) The type of VPN connection the virtual private gateway supports.
|
|
1404
|
+
:param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
|
|
1405
|
+
:param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
|
|
1406
|
+
:param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
|
|
1407
|
+
|
|
1408
|
+
:default: - no route propogation
|
|
914
1409
|
|
|
915
1410
|
:stability: experimental
|
|
916
1411
|
'''
|
|
917
|
-
|
|
1412
|
+
options = VPNGatewayV2Options(
|
|
1413
|
+
type=type,
|
|
1414
|
+
amazon_side_asn=amazon_side_asn,
|
|
1415
|
+
vpn_gateway_name=vpn_gateway_name,
|
|
1416
|
+
vpn_route_propagation=vpn_route_propagation,
|
|
1417
|
+
)
|
|
1418
|
+
|
|
1419
|
+
return typing.cast("VPNGatewayV2", jsii.invoke(self, "enableVpnGatewayV2", [options]))
|
|
918
1420
|
|
|
919
1421
|
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
920
1422
|
typing.cast(typing.Any, IVpcV2).__jsii_proxy_class__ = lambda : _IVpcV2Proxy
|
|
@@ -935,21 +1437,21 @@ class InternetGateway(
|
|
|
935
1437
|
Example::
|
|
936
1438
|
|
|
937
1439
|
stack = Stack()
|
|
938
|
-
my_vpc =
|
|
939
|
-
route_table =
|
|
1440
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
1441
|
+
route_table = RouteTable(self, "RouteTable",
|
|
940
1442
|
vpc=my_vpc
|
|
941
1443
|
)
|
|
942
|
-
subnet =
|
|
1444
|
+
subnet = SubnetV2(self, "Subnet",
|
|
943
1445
|
vpc=my_vpc,
|
|
944
1446
|
availability_zone="eu-west-2a",
|
|
945
1447
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
946
|
-
subnet_type=
|
|
1448
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
947
1449
|
)
|
|
948
1450
|
|
|
949
|
-
igw =
|
|
1451
|
+
igw = InternetGateway(self, "IGW",
|
|
950
1452
|
vpc=my_vpc
|
|
951
1453
|
)
|
|
952
|
-
|
|
1454
|
+
Route(self, "IgwRoute",
|
|
953
1455
|
route_table=route_table,
|
|
954
1456
|
destination="0.0.0.0/0",
|
|
955
1457
|
target={"gateway": igw}
|
|
@@ -968,7 +1470,7 @@ class InternetGateway(
|
|
|
968
1470
|
:param scope: -
|
|
969
1471
|
:param id: -
|
|
970
1472
|
:param vpc: (experimental) The ID of the VPC for which to create the internet gateway.
|
|
971
|
-
:param internet_gateway_name: (experimental) The resource name of the internet gateway. Default:
|
|
1473
|
+
:param internet_gateway_name: (experimental) The resource name of the internet gateway. Default: - provisioned without a resource name
|
|
972
1474
|
|
|
973
1475
|
:stability: experimental
|
|
974
1476
|
'''
|
|
@@ -1019,6 +1521,89 @@ class InternetGateway(
|
|
|
1019
1521
|
return typing.cast(builtins.str, jsii.get(self, "vpcId"))
|
|
1020
1522
|
|
|
1021
1523
|
|
|
1524
|
+
@jsii.data_type(
|
|
1525
|
+
jsii_type="@aws-cdk/aws-ec2-alpha.InternetGatewayOptions",
|
|
1526
|
+
jsii_struct_bases=[],
|
|
1527
|
+
name_mapping={
|
|
1528
|
+
"ipv4_destination": "ipv4Destination",
|
|
1529
|
+
"ipv6_destination": "ipv6Destination",
|
|
1530
|
+
},
|
|
1531
|
+
)
|
|
1532
|
+
class InternetGatewayOptions:
|
|
1533
|
+
def __init__(
|
|
1534
|
+
self,
|
|
1535
|
+
*,
|
|
1536
|
+
ipv4_destination: typing.Optional[builtins.str] = None,
|
|
1537
|
+
ipv6_destination: typing.Optional[builtins.str] = None,
|
|
1538
|
+
) -> None:
|
|
1539
|
+
'''(experimental) Options to define InternetGateway for VPC.
|
|
1540
|
+
|
|
1541
|
+
:param ipv4_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '0.0.0.0' all Ipv4 traffic
|
|
1542
|
+
:param ipv6_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
|
|
1543
|
+
|
|
1544
|
+
:stability: experimental
|
|
1545
|
+
:exampleMetadata: infused
|
|
1546
|
+
|
|
1547
|
+
Example::
|
|
1548
|
+
|
|
1549
|
+
stack = Stack()
|
|
1550
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
1551
|
+
|
|
1552
|
+
subnet = SubnetV2(self, "Subnet",
|
|
1553
|
+
vpc=my_vpc,
|
|
1554
|
+
availability_zone="eu-west-2a",
|
|
1555
|
+
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
1556
|
+
subnet_type=SubnetType.PUBLIC
|
|
1557
|
+
)
|
|
1558
|
+
|
|
1559
|
+
my_vpc.add_internet_gateway(
|
|
1560
|
+
ipv4_destination="192.168.0.0/16"
|
|
1561
|
+
)
|
|
1562
|
+
'''
|
|
1563
|
+
if __debug__:
|
|
1564
|
+
type_hints = typing.get_type_hints(_typecheckingstub__1767be14586e30c26bcd910b9753aae1720568db2bf09fbf8dd100e10ab1fc09)
|
|
1565
|
+
check_type(argname="argument ipv4_destination", value=ipv4_destination, expected_type=type_hints["ipv4_destination"])
|
|
1566
|
+
check_type(argname="argument ipv6_destination", value=ipv6_destination, expected_type=type_hints["ipv6_destination"])
|
|
1567
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
1568
|
+
if ipv4_destination is not None:
|
|
1569
|
+
self._values["ipv4_destination"] = ipv4_destination
|
|
1570
|
+
if ipv6_destination is not None:
|
|
1571
|
+
self._values["ipv6_destination"] = ipv6_destination
|
|
1572
|
+
|
|
1573
|
+
@builtins.property
|
|
1574
|
+
def ipv4_destination(self) -> typing.Optional[builtins.str]:
|
|
1575
|
+
'''(experimental) Destination Ipv6 address for EGW route.
|
|
1576
|
+
|
|
1577
|
+
:default: - '0.0.0.0' all Ipv4 traffic
|
|
1578
|
+
|
|
1579
|
+
:stability: experimental
|
|
1580
|
+
'''
|
|
1581
|
+
result = self._values.get("ipv4_destination")
|
|
1582
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
1583
|
+
|
|
1584
|
+
@builtins.property
|
|
1585
|
+
def ipv6_destination(self) -> typing.Optional[builtins.str]:
|
|
1586
|
+
'''(experimental) Destination Ipv6 address for EGW route.
|
|
1587
|
+
|
|
1588
|
+
:default: - '::/0' all Ipv6 traffic
|
|
1589
|
+
|
|
1590
|
+
:stability: experimental
|
|
1591
|
+
'''
|
|
1592
|
+
result = self._values.get("ipv6_destination")
|
|
1593
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
1594
|
+
|
|
1595
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
1596
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
1597
|
+
|
|
1598
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
1599
|
+
return not (rhs == self)
|
|
1600
|
+
|
|
1601
|
+
def __repr__(self) -> str:
|
|
1602
|
+
return "InternetGatewayOptions(%s)" % ", ".join(
|
|
1603
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
1604
|
+
)
|
|
1605
|
+
|
|
1606
|
+
|
|
1022
1607
|
@jsii.data_type(
|
|
1023
1608
|
jsii_type="@aws-cdk/aws-ec2-alpha.InternetGatewayProps",
|
|
1024
1609
|
jsii_struct_bases=[],
|
|
@@ -1034,7 +1619,7 @@ class InternetGatewayProps:
|
|
|
1034
1619
|
'''(experimental) Properties to define an internet gateway.
|
|
1035
1620
|
|
|
1036
1621
|
:param vpc: (experimental) The ID of the VPC for which to create the internet gateway.
|
|
1037
|
-
:param internet_gateway_name: (experimental) The resource name of the internet gateway. Default:
|
|
1622
|
+
:param internet_gateway_name: (experimental) The resource name of the internet gateway. Default: - provisioned without a resource name
|
|
1038
1623
|
|
|
1039
1624
|
:stability: experimental
|
|
1040
1625
|
:exampleMetadata: infused
|
|
@@ -1042,21 +1627,21 @@ class InternetGatewayProps:
|
|
|
1042
1627
|
Example::
|
|
1043
1628
|
|
|
1044
1629
|
stack = Stack()
|
|
1045
|
-
my_vpc =
|
|
1046
|
-
route_table =
|
|
1630
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
1631
|
+
route_table = RouteTable(self, "RouteTable",
|
|
1047
1632
|
vpc=my_vpc
|
|
1048
1633
|
)
|
|
1049
|
-
subnet =
|
|
1634
|
+
subnet = SubnetV2(self, "Subnet",
|
|
1050
1635
|
vpc=my_vpc,
|
|
1051
1636
|
availability_zone="eu-west-2a",
|
|
1052
1637
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
1053
|
-
subnet_type=
|
|
1638
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
1054
1639
|
)
|
|
1055
1640
|
|
|
1056
|
-
igw =
|
|
1641
|
+
igw = InternetGateway(self, "IGW",
|
|
1057
1642
|
vpc=my_vpc
|
|
1058
1643
|
)
|
|
1059
|
-
|
|
1644
|
+
Route(self, "IgwRoute",
|
|
1060
1645
|
route_table=route_table,
|
|
1061
1646
|
destination="0.0.0.0/0",
|
|
1062
1647
|
target={"gateway": igw}
|
|
@@ -1086,7 +1671,7 @@ class InternetGatewayProps:
|
|
|
1086
1671
|
def internet_gateway_name(self) -> typing.Optional[builtins.str]:
|
|
1087
1672
|
'''(experimental) The resource name of the internet gateway.
|
|
1088
1673
|
|
|
1089
|
-
:default:
|
|
1674
|
+
:default: - provisioned without a resource name
|
|
1090
1675
|
|
|
1091
1676
|
:stability: experimental
|
|
1092
1677
|
'''
|
|
@@ -1112,24 +1697,15 @@ class IpAddresses(
|
|
|
1112
1697
|
'''(experimental) IpAddress options to define VPC V2.
|
|
1113
1698
|
|
|
1114
1699
|
:stability: experimental
|
|
1115
|
-
:exampleMetadata:
|
|
1700
|
+
:exampleMetadata: fixture=_generated
|
|
1116
1701
|
|
|
1117
1702
|
Example::
|
|
1118
1703
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIp")
|
|
1123
|
-
]
|
|
1124
|
-
)
|
|
1704
|
+
# The code below shows an example of how to instantiate this type.
|
|
1705
|
+
# The values are placeholders you should change.
|
|
1706
|
+
import aws_cdk.aws_ec2_alpha as ec2_alpha
|
|
1125
1707
|
|
|
1126
|
-
|
|
1127
|
-
vpc=my_vpc,
|
|
1128
|
-
availability_zone="us-east-1a",
|
|
1129
|
-
ipv4_cidr_block=vpc_v2.IpCidr("10.0.0.0/24"),
|
|
1130
|
-
ipv6_cidr_block=vpc_v2.IpCidr("2a05:d02c:25:4000::/60"),
|
|
1131
|
-
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
|
|
1132
|
-
)
|
|
1708
|
+
ip_addresses = ec2_alpha.IpAddresses()
|
|
1133
1709
|
'''
|
|
1134
1710
|
|
|
1135
1711
|
def __init__(self) -> None:
|
|
@@ -1185,8 +1761,8 @@ class IpAddresses(
|
|
|
1185
1761
|
'''(experimental) An Ipv4 Ipam Pool.
|
|
1186
1762
|
|
|
1187
1763
|
:param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource.
|
|
1188
|
-
:param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: -
|
|
1189
|
-
:param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: -
|
|
1764
|
+
:param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - no pool attached to VPC secondary address
|
|
1765
|
+
:param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - no netmask length for IPAM attached to VPC secondary address
|
|
1190
1766
|
|
|
1191
1767
|
:stability: experimental
|
|
1192
1768
|
'''
|
|
@@ -1210,8 +1786,8 @@ class IpAddresses(
|
|
|
1210
1786
|
'''(experimental) An Ipv6 Ipam Pool.
|
|
1211
1787
|
|
|
1212
1788
|
:param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource.
|
|
1213
|
-
:param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: -
|
|
1214
|
-
:param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: -
|
|
1789
|
+
:param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - no pool attached to VPC secondary address
|
|
1790
|
+
:param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - no netmask length for IPAM attached to VPC secondary address
|
|
1215
1791
|
|
|
1216
1792
|
:stability: experimental
|
|
1217
1793
|
'''
|
|
@@ -1233,24 +1809,21 @@ class IpCidr(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/aws-ec2-alpha.IpCidr")
|
|
|
1233
1809
|
Example::
|
|
1234
1810
|
|
|
1235
1811
|
stack = Stack()
|
|
1236
|
-
my_vpc =
|
|
1237
|
-
route_table =
|
|
1812
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
1813
|
+
route_table = RouteTable(self, "RouteTable",
|
|
1238
1814
|
vpc=my_vpc
|
|
1239
1815
|
)
|
|
1240
|
-
subnet =
|
|
1816
|
+
subnet = SubnetV2(self, "Subnet",
|
|
1241
1817
|
vpc=my_vpc,
|
|
1242
1818
|
availability_zone="eu-west-2a",
|
|
1243
1819
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
1244
|
-
subnet_type=
|
|
1820
|
+
subnet_type=SubnetType.PUBLIC
|
|
1245
1821
|
)
|
|
1246
1822
|
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
route_table=route_table,
|
|
1252
|
-
destination="0.0.0.0/0",
|
|
1253
|
-
target={"gateway": igw}
|
|
1823
|
+
my_vpc.add_internet_gateway()
|
|
1824
|
+
my_vpc.add_nat_gateway(
|
|
1825
|
+
subnet=subnet,
|
|
1826
|
+
connectivity_type=NatConnectivityType.PUBLIC
|
|
1254
1827
|
)
|
|
1255
1828
|
'''
|
|
1256
1829
|
|
|
@@ -1294,28 +1867,28 @@ class Ipam(
|
|
|
1294
1867
|
operating_region=["us-west-1"]
|
|
1295
1868
|
)
|
|
1296
1869
|
ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
|
|
1297
|
-
address_family=
|
|
1870
|
+
address_family=AddressFamily.IP_V6,
|
|
1298
1871
|
aws_service=AwsServiceName.EC2,
|
|
1299
1872
|
locale="us-west-1",
|
|
1300
|
-
public_ip_source=
|
|
1873
|
+
public_ip_source=IpamPoolPublicIpSource.AMAZON
|
|
1301
1874
|
)
|
|
1302
1875
|
ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
|
|
1303
1876
|
|
|
1304
1877
|
ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
|
|
1305
|
-
address_family=
|
|
1878
|
+
address_family=AddressFamily.IP_V4
|
|
1306
1879
|
)
|
|
1307
1880
|
ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
|
|
1308
1881
|
|
|
1309
|
-
|
|
1310
|
-
primary_address_block=
|
|
1882
|
+
VpcV2(self, "Vpc",
|
|
1883
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
1311
1884
|
secondary_address_blocks=[
|
|
1312
|
-
|
|
1313
|
-
|
|
1885
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
|
|
1886
|
+
IpAddresses.ipv6_ipam(
|
|
1314
1887
|
ipam_pool=ipam_public_pool,
|
|
1315
1888
|
netmask_length=52,
|
|
1316
1889
|
cidr_block_name="ipv6Ipam"
|
|
1317
1890
|
),
|
|
1318
|
-
|
|
1891
|
+
IpAddresses.ipv4_ipam(
|
|
1319
1892
|
ipam_pool=ipam_private_pool,
|
|
1320
1893
|
netmask_length=8,
|
|
1321
1894
|
cidr_block_name="ipv4Ipam"
|
|
@@ -1335,8 +1908,8 @@ class Ipam(
|
|
|
1335
1908
|
'''
|
|
1336
1909
|
:param scope: -
|
|
1337
1910
|
:param id: -
|
|
1338
|
-
:param ipam_name: (experimental) Name of IPAM that can be used for tagging resource. Default:
|
|
1339
|
-
:param operating_region: (experimental) The operating Regions for an IPAM. Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* . Default: Stack.region if defined
|
|
1911
|
+
:param ipam_name: (experimental) Name of IPAM that can be used for tagging resource. Default: - If no name provided, no tags will be added to the IPAM
|
|
1912
|
+
:param operating_region: (experimental) The operating Regions for an IPAM. Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* . Default: - Stack.region if defined in the stack
|
|
1340
1913
|
|
|
1341
1914
|
:stability: experimental
|
|
1342
1915
|
'''
|
|
@@ -1360,7 +1933,7 @@ class Ipam(
|
|
|
1360
1933
|
|
|
1361
1934
|
:param scope: -
|
|
1362
1935
|
:param id: -
|
|
1363
|
-
:param ipam_scope_name: (experimental) IPAM scope name that will be used for tagging. Default:
|
|
1936
|
+
:param ipam_scope_name: (experimental) IPAM scope name that will be used for tagging. Default: - no tags will be added to the scope
|
|
1364
1937
|
|
|
1365
1938
|
:stability: experimental
|
|
1366
1939
|
'''
|
|
@@ -1447,8 +2020,8 @@ class IpamOptions:
|
|
|
1447
2020
|
For more information, see the {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipam.html}.
|
|
1448
2021
|
|
|
1449
2022
|
:param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource.
|
|
1450
|
-
:param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: -
|
|
1451
|
-
:param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: -
|
|
2023
|
+
:param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - no pool attached to VPC secondary address
|
|
2024
|
+
:param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - no netmask length for IPAM attached to VPC secondary address
|
|
1452
2025
|
|
|
1453
2026
|
:stability: experimental
|
|
1454
2027
|
:exampleMetadata: infused
|
|
@@ -1460,28 +2033,28 @@ class IpamOptions:
|
|
|
1460
2033
|
operating_region=["us-west-1"]
|
|
1461
2034
|
)
|
|
1462
2035
|
ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
|
|
1463
|
-
address_family=
|
|
2036
|
+
address_family=AddressFamily.IP_V6,
|
|
1464
2037
|
aws_service=AwsServiceName.EC2,
|
|
1465
2038
|
locale="us-west-1",
|
|
1466
|
-
public_ip_source=
|
|
2039
|
+
public_ip_source=IpamPoolPublicIpSource.AMAZON
|
|
1467
2040
|
)
|
|
1468
2041
|
ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
|
|
1469
2042
|
|
|
1470
2043
|
ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
|
|
1471
|
-
address_family=
|
|
2044
|
+
address_family=AddressFamily.IP_V4
|
|
1472
2045
|
)
|
|
1473
2046
|
ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
|
|
1474
2047
|
|
|
1475
|
-
|
|
1476
|
-
primary_address_block=
|
|
2048
|
+
VpcV2(self, "Vpc",
|
|
2049
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
1477
2050
|
secondary_address_blocks=[
|
|
1478
|
-
|
|
1479
|
-
|
|
2051
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
|
|
2052
|
+
IpAddresses.ipv6_ipam(
|
|
1480
2053
|
ipam_pool=ipam_public_pool,
|
|
1481
2054
|
netmask_length=52,
|
|
1482
2055
|
cidr_block_name="ipv6Ipam"
|
|
1483
2056
|
),
|
|
1484
|
-
|
|
2057
|
+
IpAddresses.ipv4_ipam(
|
|
1485
2058
|
ipam_pool=ipam_private_pool,
|
|
1486
2059
|
netmask_length=8,
|
|
1487
2060
|
cidr_block_name="ipv4Ipam"
|
|
@@ -1516,7 +2089,7 @@ class IpamOptions:
|
|
|
1516
2089
|
def ipam_pool(self) -> typing.Optional[IIpamPool]:
|
|
1517
2090
|
'''(experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam.
|
|
1518
2091
|
|
|
1519
|
-
:default: -
|
|
2092
|
+
:default: - no pool attached to VPC secondary address
|
|
1520
2093
|
|
|
1521
2094
|
:stability: experimental
|
|
1522
2095
|
'''
|
|
@@ -1527,7 +2100,7 @@ class IpamOptions:
|
|
|
1527
2100
|
def netmask_length(self) -> typing.Optional[jsii.Number]:
|
|
1528
2101
|
'''(experimental) CIDR Mask for Vpc Only required when using AWS Ipam.
|
|
1529
2102
|
|
|
1530
|
-
:default: -
|
|
2103
|
+
:default: - no netmask length for IPAM attached to VPC secondary address
|
|
1531
2104
|
|
|
1532
2105
|
:stability: experimental
|
|
1533
2106
|
'''
|
|
@@ -1562,8 +2135,8 @@ class IpamPoolCidrProvisioningOptions:
|
|
|
1562
2135
|
|
|
1563
2136
|
Used to create a new IpamPoolCidr
|
|
1564
2137
|
|
|
1565
|
-
:param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default:
|
|
1566
|
-
:param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default:
|
|
2138
|
+
:param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: - pool provisioned without netmask length, need netmask length in this case
|
|
2139
|
+
:param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: - pool provisioned without netmask length, need cidr range in this case
|
|
1567
2140
|
|
|
1568
2141
|
:see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampoolcidr.html
|
|
1569
2142
|
:stability: experimental
|
|
@@ -1576,28 +2149,28 @@ class IpamPoolCidrProvisioningOptions:
|
|
|
1576
2149
|
operating_region=["us-west-1"]
|
|
1577
2150
|
)
|
|
1578
2151
|
ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
|
|
1579
|
-
address_family=
|
|
2152
|
+
address_family=AddressFamily.IP_V6,
|
|
1580
2153
|
aws_service=AwsServiceName.EC2,
|
|
1581
2154
|
locale="us-west-1",
|
|
1582
|
-
public_ip_source=
|
|
2155
|
+
public_ip_source=IpamPoolPublicIpSource.AMAZON
|
|
1583
2156
|
)
|
|
1584
2157
|
ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
|
|
1585
2158
|
|
|
1586
2159
|
ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
|
|
1587
|
-
address_family=
|
|
2160
|
+
address_family=AddressFamily.IP_V4
|
|
1588
2161
|
)
|
|
1589
2162
|
ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
|
|
1590
2163
|
|
|
1591
|
-
|
|
1592
|
-
primary_address_block=
|
|
2164
|
+
VpcV2(self, "Vpc",
|
|
2165
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
1593
2166
|
secondary_address_blocks=[
|
|
1594
|
-
|
|
1595
|
-
|
|
2167
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
|
|
2168
|
+
IpAddresses.ipv6_ipam(
|
|
1596
2169
|
ipam_pool=ipam_public_pool,
|
|
1597
2170
|
netmask_length=52,
|
|
1598
2171
|
cidr_block_name="ipv6Ipam"
|
|
1599
2172
|
),
|
|
1600
|
-
|
|
2173
|
+
IpAddresses.ipv4_ipam(
|
|
1601
2174
|
ipam_pool=ipam_private_pool,
|
|
1602
2175
|
netmask_length=8,
|
|
1603
2176
|
cidr_block_name="ipv4Ipam"
|
|
@@ -1619,7 +2192,7 @@ class IpamPoolCidrProvisioningOptions:
|
|
|
1619
2192
|
def cidr(self) -> typing.Optional[builtins.str]:
|
|
1620
2193
|
'''(experimental) Ipv6 CIDR block for the IPAM pool.
|
|
1621
2194
|
|
|
1622
|
-
:default:
|
|
2195
|
+
:default: - pool provisioned without netmask length, need netmask length in this case
|
|
1623
2196
|
|
|
1624
2197
|
:stability: experimental
|
|
1625
2198
|
'''
|
|
@@ -1630,7 +2203,7 @@ class IpamPoolCidrProvisioningOptions:
|
|
|
1630
2203
|
def netmask_length(self) -> typing.Optional[jsii.Number]:
|
|
1631
2204
|
'''(experimental) Ipv6 Netmask length for the CIDR.
|
|
1632
2205
|
|
|
1633
|
-
:default:
|
|
2206
|
+
:default: - pool provisioned without netmask length, need cidr range in this case
|
|
1634
2207
|
|
|
1635
2208
|
:stability: experimental
|
|
1636
2209
|
'''
|
|
@@ -1666,28 +2239,28 @@ class IpamPoolPublicIpSource(enum.Enum):
|
|
|
1666
2239
|
operating_region=["us-west-1"]
|
|
1667
2240
|
)
|
|
1668
2241
|
ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
|
|
1669
|
-
address_family=
|
|
2242
|
+
address_family=AddressFamily.IP_V6,
|
|
1670
2243
|
aws_service=AwsServiceName.EC2,
|
|
1671
2244
|
locale="us-west-1",
|
|
1672
|
-
public_ip_source=
|
|
2245
|
+
public_ip_source=IpamPoolPublicIpSource.AMAZON
|
|
1673
2246
|
)
|
|
1674
2247
|
ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
|
|
1675
2248
|
|
|
1676
2249
|
ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
|
|
1677
|
-
address_family=
|
|
2250
|
+
address_family=AddressFamily.IP_V4
|
|
1678
2251
|
)
|
|
1679
2252
|
ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
|
|
1680
2253
|
|
|
1681
|
-
|
|
1682
|
-
primary_address_block=
|
|
2254
|
+
VpcV2(self, "Vpc",
|
|
2255
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
1683
2256
|
secondary_address_blocks=[
|
|
1684
|
-
|
|
1685
|
-
|
|
2257
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
|
|
2258
|
+
IpAddresses.ipv6_ipam(
|
|
1686
2259
|
ipam_pool=ipam_public_pool,
|
|
1687
2260
|
netmask_length=52,
|
|
1688
2261
|
cidr_block_name="ipv6Ipam"
|
|
1689
2262
|
),
|
|
1690
|
-
|
|
2263
|
+
IpAddresses.ipv4_ipam(
|
|
1691
2264
|
ipam_pool=ipam_private_pool,
|
|
1692
2265
|
netmask_length=8,
|
|
1693
2266
|
cidr_block_name="ipv4Ipam"
|
|
@@ -1722,8 +2295,8 @@ class IpamProps:
|
|
|
1722
2295
|
) -> None:
|
|
1723
2296
|
'''(experimental) Options to create a new Ipam in the account.
|
|
1724
2297
|
|
|
1725
|
-
:param ipam_name: (experimental) Name of IPAM that can be used for tagging resource. Default:
|
|
1726
|
-
:param operating_region: (experimental) The operating Regions for an IPAM. Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* . Default: Stack.region if defined
|
|
2298
|
+
:param ipam_name: (experimental) Name of IPAM that can be used for tagging resource. Default: - If no name provided, no tags will be added to the IPAM
|
|
2299
|
+
:param operating_region: (experimental) The operating Regions for an IPAM. Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* . Default: - Stack.region if defined in the stack
|
|
1727
2300
|
|
|
1728
2301
|
:stability: experimental
|
|
1729
2302
|
:exampleMetadata: infused
|
|
@@ -1735,28 +2308,28 @@ class IpamProps:
|
|
|
1735
2308
|
operating_region=["us-west-1"]
|
|
1736
2309
|
)
|
|
1737
2310
|
ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
|
|
1738
|
-
address_family=
|
|
2311
|
+
address_family=AddressFamily.IP_V6,
|
|
1739
2312
|
aws_service=AwsServiceName.EC2,
|
|
1740
2313
|
locale="us-west-1",
|
|
1741
|
-
public_ip_source=
|
|
2314
|
+
public_ip_source=IpamPoolPublicIpSource.AMAZON
|
|
1742
2315
|
)
|
|
1743
2316
|
ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
|
|
1744
2317
|
|
|
1745
2318
|
ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
|
|
1746
|
-
address_family=
|
|
2319
|
+
address_family=AddressFamily.IP_V4
|
|
1747
2320
|
)
|
|
1748
2321
|
ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
|
|
1749
2322
|
|
|
1750
|
-
|
|
1751
|
-
primary_address_block=
|
|
2323
|
+
VpcV2(self, "Vpc",
|
|
2324
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
1752
2325
|
secondary_address_blocks=[
|
|
1753
|
-
|
|
1754
|
-
|
|
2326
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
|
|
2327
|
+
IpAddresses.ipv6_ipam(
|
|
1755
2328
|
ipam_pool=ipam_public_pool,
|
|
1756
2329
|
netmask_length=52,
|
|
1757
2330
|
cidr_block_name="ipv6Ipam"
|
|
1758
2331
|
),
|
|
1759
|
-
|
|
2332
|
+
IpAddresses.ipv4_ipam(
|
|
1760
2333
|
ipam_pool=ipam_private_pool,
|
|
1761
2334
|
netmask_length=8,
|
|
1762
2335
|
cidr_block_name="ipv4Ipam"
|
|
@@ -1778,7 +2351,7 @@ class IpamProps:
|
|
|
1778
2351
|
def ipam_name(self) -> typing.Optional[builtins.str]:
|
|
1779
2352
|
'''(experimental) Name of IPAM that can be used for tagging resource.
|
|
1780
2353
|
|
|
1781
|
-
:default:
|
|
2354
|
+
:default: - If no name provided, no tags will be added to the IPAM
|
|
1782
2355
|
|
|
1783
2356
|
:stability: experimental
|
|
1784
2357
|
'''
|
|
@@ -1792,7 +2365,7 @@ class IpamProps:
|
|
|
1792
2365
|
Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs
|
|
1793
2366
|
For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* .
|
|
1794
2367
|
|
|
1795
|
-
:default: Stack.region if defined
|
|
2368
|
+
:default: - Stack.region if defined in the stack
|
|
1796
2369
|
|
|
1797
2370
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipam.html#cfn-ec2-ipam-operatingregions
|
|
1798
2371
|
:stability: experimental
|
|
@@ -1825,7 +2398,7 @@ class IpamScopeOptions:
|
|
|
1825
2398
|
) -> None:
|
|
1826
2399
|
'''(experimental) Being used in IPAM class to add pools to default scope created by IPAM.
|
|
1827
2400
|
|
|
1828
|
-
:param ipam_scope_name: (experimental) IPAM scope name that will be used for tagging. Default:
|
|
2401
|
+
:param ipam_scope_name: (experimental) IPAM scope name that will be used for tagging. Default: - no tags will be added to the scope
|
|
1829
2402
|
|
|
1830
2403
|
:stability: experimental
|
|
1831
2404
|
:exampleMetadata: fixture=_generated
|
|
@@ -1851,7 +2424,7 @@ class IpamScopeOptions:
|
|
|
1851
2424
|
def ipam_scope_name(self) -> typing.Optional[builtins.str]:
|
|
1852
2425
|
'''(experimental) IPAM scope name that will be used for tagging.
|
|
1853
2426
|
|
|
1854
|
-
:default:
|
|
2427
|
+
:default: - no tags will be added to the scope
|
|
1855
2428
|
|
|
1856
2429
|
:stability: experimental
|
|
1857
2430
|
'''
|
|
@@ -1901,24 +2474,24 @@ class NatConnectivityType(enum.Enum):
|
|
|
1901
2474
|
|
|
1902
2475
|
Example::
|
|
1903
2476
|
|
|
1904
|
-
my_vpc =
|
|
1905
|
-
route_table =
|
|
2477
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
2478
|
+
route_table = RouteTable(self, "RouteTable",
|
|
1906
2479
|
vpc=my_vpc
|
|
1907
2480
|
)
|
|
1908
|
-
subnet =
|
|
2481
|
+
subnet = SubnetV2(self, "Subnet",
|
|
1909
2482
|
vpc=my_vpc,
|
|
1910
2483
|
availability_zone="eu-west-2a",
|
|
1911
2484
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
1912
|
-
subnet_type=
|
|
2485
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
1913
2486
|
)
|
|
1914
2487
|
|
|
1915
|
-
natgw =
|
|
2488
|
+
natgw = NatGateway(self, "NatGW",
|
|
1916
2489
|
subnet=subnet,
|
|
1917
2490
|
vpc=my_vpc,
|
|
1918
2491
|
connectivity_type=NatConnectivityType.PRIVATE,
|
|
1919
2492
|
private_ip_address="10.0.0.42"
|
|
1920
2493
|
)
|
|
1921
|
-
|
|
2494
|
+
Route(self, "NatGwRoute",
|
|
1922
2495
|
route_table=route_table,
|
|
1923
2496
|
destination="0.0.0.0/0",
|
|
1924
2497
|
target={"gateway": natgw}
|
|
@@ -1951,24 +2524,24 @@ class NatGateway(
|
|
|
1951
2524
|
|
|
1952
2525
|
Example::
|
|
1953
2526
|
|
|
1954
|
-
my_vpc =
|
|
1955
|
-
route_table =
|
|
2527
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
2528
|
+
route_table = RouteTable(self, "RouteTable",
|
|
1956
2529
|
vpc=my_vpc
|
|
1957
2530
|
)
|
|
1958
|
-
subnet =
|
|
2531
|
+
subnet = SubnetV2(self, "Subnet",
|
|
1959
2532
|
vpc=my_vpc,
|
|
1960
2533
|
availability_zone="eu-west-2a",
|
|
1961
2534
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
1962
|
-
subnet_type=
|
|
2535
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
1963
2536
|
)
|
|
1964
2537
|
|
|
1965
|
-
natgw =
|
|
2538
|
+
natgw = NatGateway(self, "NatGW",
|
|
1966
2539
|
subnet=subnet,
|
|
1967
2540
|
vpc=my_vpc,
|
|
1968
2541
|
connectivity_type=NatConnectivityType.PRIVATE,
|
|
1969
2542
|
private_ip_address="10.0.0.42"
|
|
1970
2543
|
)
|
|
1971
|
-
|
|
2544
|
+
Route(self, "NatGwRoute",
|
|
1972
2545
|
route_table=route_table,
|
|
1973
2546
|
destination="0.0.0.0/0",
|
|
1974
2547
|
target={"gateway": natgw}
|
|
@@ -1980,7 +2553,8 @@ class NatGateway(
|
|
|
1980
2553
|
scope: _constructs_77d1e7e8.Construct,
|
|
1981
2554
|
id: builtins.str,
|
|
1982
2555
|
*,
|
|
1983
|
-
|
|
2556
|
+
vpc: typing.Optional[IVpcV2] = None,
|
|
2557
|
+
subnet: ISubnetV2,
|
|
1984
2558
|
allocation_id: typing.Optional[builtins.str] = None,
|
|
1985
2559
|
connectivity_type: typing.Optional[NatConnectivityType] = None,
|
|
1986
2560
|
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
@@ -1989,96 +2563,317 @@ class NatGateway(
|
|
|
1989
2563
|
secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
1990
2564
|
secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
|
|
1991
2565
|
secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
1992
|
-
vpc: typing.Optional[IVpcV2] = None,
|
|
1993
2566
|
) -> None:
|
|
1994
2567
|
'''
|
|
1995
2568
|
:param scope: -
|
|
1996
2569
|
:param id: -
|
|
2570
|
+
:param vpc: (experimental) The ID of the VPC in which the NAT gateway is located. Default: - no elastic ip associated, required in case of public connectivity if ``AllocationId`` is not defined
|
|
2571
|
+
:param subnet: (experimental) The subnet in which the NAT gateway is located.
|
|
2572
|
+
:param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
|
|
2573
|
+
:param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
|
|
2574
|
+
:param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
|
|
2575
|
+
:param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
|
|
2576
|
+
:param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
2577
|
+
:param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
|
|
2578
|
+
:param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
|
|
2579
|
+
:param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
|
|
2580
|
+
|
|
2581
|
+
:stability: experimental
|
|
2582
|
+
'''
|
|
2583
|
+
if __debug__:
|
|
2584
|
+
type_hints = typing.get_type_hints(_typecheckingstub__3204c5cc1ee92d73075b1e2c597a7d7bb9eb73b154f33262369b6b4ac9ec33f4)
|
|
2585
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
2586
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
2587
|
+
props = NatGatewayProps(
|
|
2588
|
+
vpc=vpc,
|
|
2589
|
+
subnet=subnet,
|
|
2590
|
+
allocation_id=allocation_id,
|
|
2591
|
+
connectivity_type=connectivity_type,
|
|
2592
|
+
max_drain_duration=max_drain_duration,
|
|
2593
|
+
nat_gateway_name=nat_gateway_name,
|
|
2594
|
+
private_ip_address=private_ip_address,
|
|
2595
|
+
secondary_allocation_ids=secondary_allocation_ids,
|
|
2596
|
+
secondary_private_ip_address_count=secondary_private_ip_address_count,
|
|
2597
|
+
secondary_private_ip_addresses=secondary_private_ip_addresses,
|
|
2598
|
+
)
|
|
2599
|
+
|
|
2600
|
+
jsii.create(self.__class__, self, [scope, id, props])
|
|
2601
|
+
|
|
2602
|
+
@builtins.property
|
|
2603
|
+
@jsii.member(jsii_name="resource")
|
|
2604
|
+
def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnNatGateway:
|
|
2605
|
+
'''(experimental) The NAT gateway CFN resource.
|
|
2606
|
+
|
|
2607
|
+
:stability: experimental
|
|
2608
|
+
'''
|
|
2609
|
+
return typing.cast(_aws_cdk_aws_ec2_ceddda9d.CfnNatGateway, jsii.get(self, "resource"))
|
|
2610
|
+
|
|
2611
|
+
@builtins.property
|
|
2612
|
+
@jsii.member(jsii_name="routerTargetId")
|
|
2613
|
+
def router_target_id(self) -> builtins.str:
|
|
2614
|
+
'''(experimental) The ID of the route target.
|
|
2615
|
+
|
|
2616
|
+
:stability: experimental
|
|
2617
|
+
'''
|
|
2618
|
+
return typing.cast(builtins.str, jsii.get(self, "routerTargetId"))
|
|
2619
|
+
|
|
2620
|
+
@builtins.property
|
|
2621
|
+
@jsii.member(jsii_name="routerType")
|
|
2622
|
+
def router_type(self) -> _aws_cdk_aws_ec2_ceddda9d.RouterType:
|
|
2623
|
+
'''(experimental) The type of router used in the route.
|
|
2624
|
+
|
|
2625
|
+
:stability: experimental
|
|
2626
|
+
'''
|
|
2627
|
+
return typing.cast(_aws_cdk_aws_ec2_ceddda9d.RouterType, jsii.get(self, "routerType"))
|
|
2628
|
+
|
|
2629
|
+
@builtins.property
|
|
2630
|
+
@jsii.member(jsii_name="connectivityType")
|
|
2631
|
+
def connectivity_type(self) -> typing.Optional[NatConnectivityType]:
|
|
2632
|
+
'''(experimental) Indicates whether the NAT gateway supports public or private connectivity.
|
|
2633
|
+
|
|
2634
|
+
:default: public
|
|
2635
|
+
|
|
2636
|
+
:stability: experimental
|
|
2637
|
+
'''
|
|
2638
|
+
return typing.cast(typing.Optional[NatConnectivityType], jsii.get(self, "connectivityType"))
|
|
2639
|
+
|
|
2640
|
+
@builtins.property
|
|
2641
|
+
@jsii.member(jsii_name="maxDrainDuration")
|
|
2642
|
+
def max_drain_duration(self) -> typing.Optional[_aws_cdk_ceddda9d.Duration]:
|
|
2643
|
+
'''(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.
|
|
2644
|
+
|
|
2645
|
+
:default: '350 seconds'
|
|
2646
|
+
|
|
2647
|
+
:stability: experimental
|
|
2648
|
+
'''
|
|
2649
|
+
return typing.cast(typing.Optional[_aws_cdk_ceddda9d.Duration], jsii.get(self, "maxDrainDuration"))
|
|
2650
|
+
|
|
2651
|
+
|
|
2652
|
+
@jsii.data_type(
|
|
2653
|
+
jsii_type="@aws-cdk/aws-ec2-alpha.NatGatewayOptions",
|
|
2654
|
+
jsii_struct_bases=[],
|
|
2655
|
+
name_mapping={
|
|
2656
|
+
"subnet": "subnet",
|
|
2657
|
+
"allocation_id": "allocationId",
|
|
2658
|
+
"connectivity_type": "connectivityType",
|
|
2659
|
+
"max_drain_duration": "maxDrainDuration",
|
|
2660
|
+
"nat_gateway_name": "natGatewayName",
|
|
2661
|
+
"private_ip_address": "privateIpAddress",
|
|
2662
|
+
"secondary_allocation_ids": "secondaryAllocationIds",
|
|
2663
|
+
"secondary_private_ip_address_count": "secondaryPrivateIpAddressCount",
|
|
2664
|
+
"secondary_private_ip_addresses": "secondaryPrivateIpAddresses",
|
|
2665
|
+
},
|
|
2666
|
+
)
|
|
2667
|
+
class NatGatewayOptions:
|
|
2668
|
+
def __init__(
|
|
2669
|
+
self,
|
|
2670
|
+
*,
|
|
2671
|
+
subnet: ISubnetV2,
|
|
2672
|
+
allocation_id: typing.Optional[builtins.str] = None,
|
|
2673
|
+
connectivity_type: typing.Optional[NatConnectivityType] = None,
|
|
2674
|
+
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
2675
|
+
nat_gateway_name: typing.Optional[builtins.str] = None,
|
|
2676
|
+
private_ip_address: typing.Optional[builtins.str] = None,
|
|
2677
|
+
secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
2678
|
+
secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
|
|
2679
|
+
secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
2680
|
+
) -> None:
|
|
2681
|
+
'''(experimental) Options to define a NAT gateway.
|
|
2682
|
+
|
|
1997
2683
|
:param subnet: (experimental) The subnet in which the NAT gateway is located.
|
|
1998
|
-
:param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
|
|
1999
|
-
:param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default:
|
|
2000
|
-
:param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default:
|
|
2001
|
-
:param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default:
|
|
2002
|
-
:param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
2003
|
-
:param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default:
|
|
2004
|
-
:param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default:
|
|
2005
|
-
:param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default:
|
|
2006
|
-
|
|
2684
|
+
:param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
|
|
2685
|
+
:param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
|
|
2686
|
+
:param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
|
|
2687
|
+
:param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
|
|
2688
|
+
:param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
2689
|
+
:param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
|
|
2690
|
+
:param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
|
|
2691
|
+
:param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
|
|
2692
|
+
|
|
2693
|
+
:stability: experimental
|
|
2694
|
+
:exampleMetadata: infused
|
|
2695
|
+
|
|
2696
|
+
Example::
|
|
2697
|
+
|
|
2698
|
+
stack = Stack()
|
|
2699
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
2700
|
+
route_table = RouteTable(self, "RouteTable",
|
|
2701
|
+
vpc=my_vpc
|
|
2702
|
+
)
|
|
2703
|
+
subnet = SubnetV2(self, "Subnet",
|
|
2704
|
+
vpc=my_vpc,
|
|
2705
|
+
availability_zone="eu-west-2a",
|
|
2706
|
+
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
2707
|
+
subnet_type=SubnetType.PUBLIC
|
|
2708
|
+
)
|
|
2709
|
+
|
|
2710
|
+
my_vpc.add_internet_gateway()
|
|
2711
|
+
my_vpc.add_nat_gateway(
|
|
2712
|
+
subnet=subnet,
|
|
2713
|
+
connectivity_type=NatConnectivityType.PUBLIC
|
|
2714
|
+
)
|
|
2715
|
+
'''
|
|
2716
|
+
if __debug__:
|
|
2717
|
+
type_hints = typing.get_type_hints(_typecheckingstub__b95898dda7ef46705953a45c7eea2438b79c93d898a7eb07a91955ee9ff221c7)
|
|
2718
|
+
check_type(argname="argument subnet", value=subnet, expected_type=type_hints["subnet"])
|
|
2719
|
+
check_type(argname="argument allocation_id", value=allocation_id, expected_type=type_hints["allocation_id"])
|
|
2720
|
+
check_type(argname="argument connectivity_type", value=connectivity_type, expected_type=type_hints["connectivity_type"])
|
|
2721
|
+
check_type(argname="argument max_drain_duration", value=max_drain_duration, expected_type=type_hints["max_drain_duration"])
|
|
2722
|
+
check_type(argname="argument nat_gateway_name", value=nat_gateway_name, expected_type=type_hints["nat_gateway_name"])
|
|
2723
|
+
check_type(argname="argument private_ip_address", value=private_ip_address, expected_type=type_hints["private_ip_address"])
|
|
2724
|
+
check_type(argname="argument secondary_allocation_ids", value=secondary_allocation_ids, expected_type=type_hints["secondary_allocation_ids"])
|
|
2725
|
+
check_type(argname="argument secondary_private_ip_address_count", value=secondary_private_ip_address_count, expected_type=type_hints["secondary_private_ip_address_count"])
|
|
2726
|
+
check_type(argname="argument secondary_private_ip_addresses", value=secondary_private_ip_addresses, expected_type=type_hints["secondary_private_ip_addresses"])
|
|
2727
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
2728
|
+
"subnet": subnet,
|
|
2729
|
+
}
|
|
2730
|
+
if allocation_id is not None:
|
|
2731
|
+
self._values["allocation_id"] = allocation_id
|
|
2732
|
+
if connectivity_type is not None:
|
|
2733
|
+
self._values["connectivity_type"] = connectivity_type
|
|
2734
|
+
if max_drain_duration is not None:
|
|
2735
|
+
self._values["max_drain_duration"] = max_drain_duration
|
|
2736
|
+
if nat_gateway_name is not None:
|
|
2737
|
+
self._values["nat_gateway_name"] = nat_gateway_name
|
|
2738
|
+
if private_ip_address is not None:
|
|
2739
|
+
self._values["private_ip_address"] = private_ip_address
|
|
2740
|
+
if secondary_allocation_ids is not None:
|
|
2741
|
+
self._values["secondary_allocation_ids"] = secondary_allocation_ids
|
|
2742
|
+
if secondary_private_ip_address_count is not None:
|
|
2743
|
+
self._values["secondary_private_ip_address_count"] = secondary_private_ip_address_count
|
|
2744
|
+
if secondary_private_ip_addresses is not None:
|
|
2745
|
+
self._values["secondary_private_ip_addresses"] = secondary_private_ip_addresses
|
|
2746
|
+
|
|
2747
|
+
@builtins.property
|
|
2748
|
+
def subnet(self) -> ISubnetV2:
|
|
2749
|
+
'''(experimental) The subnet in which the NAT gateway is located.
|
|
2750
|
+
|
|
2751
|
+
:stability: experimental
|
|
2752
|
+
'''
|
|
2753
|
+
result = self._values.get("subnet")
|
|
2754
|
+
assert result is not None, "Required property 'subnet' is missing"
|
|
2755
|
+
return typing.cast(ISubnetV2, result)
|
|
2756
|
+
|
|
2757
|
+
@builtins.property
|
|
2758
|
+
def allocation_id(self) -> typing.Optional[builtins.str]:
|
|
2759
|
+
'''(experimental) AllocationID of Elastic IP address that's associated with the NAT gateway.
|
|
2760
|
+
|
|
2761
|
+
This property is required for a public NAT
|
|
2762
|
+
gateway and cannot be specified with a private NAT gateway.
|
|
2763
|
+
|
|
2764
|
+
:default:
|
|
2765
|
+
|
|
2766
|
+
- attr.allocationID of a new Elastic IP created by default
|
|
2767
|
+
//TODO: ADD L2 for elastic ip
|
|
2768
|
+
|
|
2769
|
+
:stability: experimental
|
|
2770
|
+
'''
|
|
2771
|
+
result = self._values.get("allocation_id")
|
|
2772
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
2773
|
+
|
|
2774
|
+
@builtins.property
|
|
2775
|
+
def connectivity_type(self) -> typing.Optional[NatConnectivityType]:
|
|
2776
|
+
'''(experimental) Indicates whether the NAT gateway supports public or private connectivity.
|
|
2777
|
+
|
|
2778
|
+
:default: NatConnectivityType.Public
|
|
2007
2779
|
|
|
2008
2780
|
:stability: experimental
|
|
2009
2781
|
'''
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
2013
|
-
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
2014
|
-
props = NatGatewayProps(
|
|
2015
|
-
subnet=subnet,
|
|
2016
|
-
allocation_id=allocation_id,
|
|
2017
|
-
connectivity_type=connectivity_type,
|
|
2018
|
-
max_drain_duration=max_drain_duration,
|
|
2019
|
-
nat_gateway_name=nat_gateway_name,
|
|
2020
|
-
private_ip_address=private_ip_address,
|
|
2021
|
-
secondary_allocation_ids=secondary_allocation_ids,
|
|
2022
|
-
secondary_private_ip_address_count=secondary_private_ip_address_count,
|
|
2023
|
-
secondary_private_ip_addresses=secondary_private_ip_addresses,
|
|
2024
|
-
vpc=vpc,
|
|
2025
|
-
)
|
|
2782
|
+
result = self._values.get("connectivity_type")
|
|
2783
|
+
return typing.cast(typing.Optional[NatConnectivityType], result)
|
|
2026
2784
|
|
|
2027
|
-
|
|
2785
|
+
@builtins.property
|
|
2786
|
+
def max_drain_duration(self) -> typing.Optional[_aws_cdk_ceddda9d.Duration]:
|
|
2787
|
+
'''(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.
|
|
2788
|
+
|
|
2789
|
+
:default: 350seconds
|
|
2790
|
+
|
|
2791
|
+
:stability: experimental
|
|
2792
|
+
'''
|
|
2793
|
+
result = self._values.get("max_drain_duration")
|
|
2794
|
+
return typing.cast(typing.Optional[_aws_cdk_ceddda9d.Duration], result)
|
|
2028
2795
|
|
|
2029
2796
|
@builtins.property
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2797
|
+
def nat_gateway_name(self) -> typing.Optional[builtins.str]:
|
|
2798
|
+
'''(experimental) The resource name of the NAT gateway.
|
|
2799
|
+
|
|
2800
|
+
:default: - NATGW provisioned without any name
|
|
2033
2801
|
|
|
2034
2802
|
:stability: experimental
|
|
2035
2803
|
'''
|
|
2036
|
-
|
|
2804
|
+
result = self._values.get("nat_gateway_name")
|
|
2805
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
2037
2806
|
|
|
2038
2807
|
@builtins.property
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2808
|
+
def private_ip_address(self) -> typing.Optional[builtins.str]:
|
|
2809
|
+
'''(experimental) The private IPv4 address to assign to the NAT gateway.
|
|
2810
|
+
|
|
2811
|
+
:default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
2042
2812
|
|
|
2043
2813
|
:stability: experimental
|
|
2044
2814
|
'''
|
|
2045
|
-
|
|
2815
|
+
result = self._values.get("private_ip_address")
|
|
2816
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
2046
2817
|
|
|
2047
2818
|
@builtins.property
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
'''(experimental) The type of router used in the route.
|
|
2819
|
+
def secondary_allocation_ids(self) -> typing.Optional[typing.List[builtins.str]]:
|
|
2820
|
+
'''(experimental) Secondary EIP allocation IDs.
|
|
2051
2821
|
|
|
2822
|
+
:default: - no secondary allocation IDs attached to NATGW
|
|
2823
|
+
|
|
2824
|
+
:see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
|
|
2052
2825
|
:stability: experimental
|
|
2053
2826
|
'''
|
|
2054
|
-
|
|
2827
|
+
result = self._values.get("secondary_allocation_ids")
|
|
2828
|
+
return typing.cast(typing.Optional[typing.List[builtins.str]], result)
|
|
2055
2829
|
|
|
2056
2830
|
@builtins.property
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
'''(experimental) Indicates whether the NAT gateway supports public or private connectivity.
|
|
2831
|
+
def secondary_private_ip_address_count(self) -> typing.Optional[jsii.Number]:
|
|
2832
|
+
'''(experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway.
|
|
2060
2833
|
|
|
2061
|
-
|
|
2834
|
+
``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be
|
|
2835
|
+
set at the same time.
|
|
2062
2836
|
|
|
2837
|
+
:default: - no secondary allocation IDs associated with NATGW
|
|
2838
|
+
|
|
2839
|
+
:see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
|
|
2063
2840
|
:stability: experimental
|
|
2064
2841
|
'''
|
|
2065
|
-
|
|
2842
|
+
result = self._values.get("secondary_private_ip_address_count")
|
|
2843
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
2066
2844
|
|
|
2067
2845
|
@builtins.property
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2846
|
+
def secondary_private_ip_addresses(
|
|
2847
|
+
self,
|
|
2848
|
+
) -> typing.Optional[typing.List[builtins.str]]:
|
|
2849
|
+
'''(experimental) Secondary private IPv4 addresses.
|
|
2850
|
+
|
|
2851
|
+
``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be
|
|
2852
|
+
set at the same time.
|
|
2071
2853
|
|
|
2072
|
-
:default:
|
|
2854
|
+
:default: - no secondary private IpAddresses associated with NATGW
|
|
2073
2855
|
|
|
2856
|
+
:see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
|
|
2074
2857
|
:stability: experimental
|
|
2075
2858
|
'''
|
|
2076
|
-
|
|
2859
|
+
result = self._values.get("secondary_private_ip_addresses")
|
|
2860
|
+
return typing.cast(typing.Optional[typing.List[builtins.str]], result)
|
|
2861
|
+
|
|
2862
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
2863
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
2864
|
+
|
|
2865
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
2866
|
+
return not (rhs == self)
|
|
2867
|
+
|
|
2868
|
+
def __repr__(self) -> str:
|
|
2869
|
+
return "NatGatewayOptions(%s)" % ", ".join(
|
|
2870
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
2871
|
+
)
|
|
2077
2872
|
|
|
2078
2873
|
|
|
2079
2874
|
@jsii.data_type(
|
|
2080
2875
|
jsii_type="@aws-cdk/aws-ec2-alpha.NatGatewayProps",
|
|
2081
|
-
jsii_struct_bases=[],
|
|
2876
|
+
jsii_struct_bases=[NatGatewayOptions],
|
|
2082
2877
|
name_mapping={
|
|
2083
2878
|
"subnet": "subnet",
|
|
2084
2879
|
"allocation_id": "allocationId",
|
|
@@ -2092,11 +2887,11 @@ class NatGateway(
|
|
|
2092
2887
|
"vpc": "vpc",
|
|
2093
2888
|
},
|
|
2094
2889
|
)
|
|
2095
|
-
class NatGatewayProps:
|
|
2890
|
+
class NatGatewayProps(NatGatewayOptions):
|
|
2096
2891
|
def __init__(
|
|
2097
2892
|
self,
|
|
2098
2893
|
*,
|
|
2099
|
-
subnet:
|
|
2894
|
+
subnet: ISubnetV2,
|
|
2100
2895
|
allocation_id: typing.Optional[builtins.str] = None,
|
|
2101
2896
|
connectivity_type: typing.Optional[NatConnectivityType] = None,
|
|
2102
2897
|
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
@@ -2110,39 +2905,39 @@ class NatGatewayProps:
|
|
|
2110
2905
|
'''(experimental) Properties to define a NAT gateway.
|
|
2111
2906
|
|
|
2112
2907
|
:param subnet: (experimental) The subnet in which the NAT gateway is located.
|
|
2113
|
-
:param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
|
|
2114
|
-
:param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default:
|
|
2115
|
-
:param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default:
|
|
2116
|
-
:param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default:
|
|
2117
|
-
:param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
2118
|
-
:param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default:
|
|
2119
|
-
:param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default:
|
|
2120
|
-
:param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default:
|
|
2121
|
-
:param vpc: (experimental) The ID of the VPC in which the NAT gateway is located. Default:
|
|
2908
|
+
:param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
|
|
2909
|
+
:param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
|
|
2910
|
+
:param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
|
|
2911
|
+
:param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
|
|
2912
|
+
:param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
2913
|
+
:param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
|
|
2914
|
+
:param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
|
|
2915
|
+
:param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
|
|
2916
|
+
:param vpc: (experimental) The ID of the VPC in which the NAT gateway is located. Default: - no elastic ip associated, required in case of public connectivity if ``AllocationId`` is not defined
|
|
2122
2917
|
|
|
2123
2918
|
:stability: experimental
|
|
2124
2919
|
:exampleMetadata: infused
|
|
2125
2920
|
|
|
2126
2921
|
Example::
|
|
2127
2922
|
|
|
2128
|
-
my_vpc =
|
|
2129
|
-
route_table =
|
|
2923
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
2924
|
+
route_table = RouteTable(self, "RouteTable",
|
|
2130
2925
|
vpc=my_vpc
|
|
2131
2926
|
)
|
|
2132
|
-
subnet =
|
|
2927
|
+
subnet = SubnetV2(self, "Subnet",
|
|
2133
2928
|
vpc=my_vpc,
|
|
2134
2929
|
availability_zone="eu-west-2a",
|
|
2135
2930
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
2136
|
-
subnet_type=
|
|
2931
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
2137
2932
|
)
|
|
2138
2933
|
|
|
2139
|
-
natgw =
|
|
2934
|
+
natgw = NatGateway(self, "NatGW",
|
|
2140
2935
|
subnet=subnet,
|
|
2141
2936
|
vpc=my_vpc,
|
|
2142
2937
|
connectivity_type=NatConnectivityType.PRIVATE,
|
|
2143
2938
|
private_ip_address="10.0.0.42"
|
|
2144
2939
|
)
|
|
2145
|
-
|
|
2940
|
+
Route(self, "NatGwRoute",
|
|
2146
2941
|
route_table=route_table,
|
|
2147
2942
|
destination="0.0.0.0/0",
|
|
2148
2943
|
target={"gateway": natgw}
|
|
@@ -2183,14 +2978,14 @@ class NatGatewayProps:
|
|
|
2183
2978
|
self._values["vpc"] = vpc
|
|
2184
2979
|
|
|
2185
2980
|
@builtins.property
|
|
2186
|
-
def subnet(self) ->
|
|
2981
|
+
def subnet(self) -> ISubnetV2:
|
|
2187
2982
|
'''(experimental) The subnet in which the NAT gateway is located.
|
|
2188
2983
|
|
|
2189
2984
|
:stability: experimental
|
|
2190
2985
|
'''
|
|
2191
2986
|
result = self._values.get("subnet")
|
|
2192
2987
|
assert result is not None, "Required property 'subnet' is missing"
|
|
2193
|
-
return typing.cast(
|
|
2988
|
+
return typing.cast(ISubnetV2, result)
|
|
2194
2989
|
|
|
2195
2990
|
@builtins.property
|
|
2196
2991
|
def allocation_id(self) -> typing.Optional[builtins.str]:
|
|
@@ -2201,7 +2996,7 @@ class NatGatewayProps:
|
|
|
2201
2996
|
|
|
2202
2997
|
:default:
|
|
2203
2998
|
|
|
2204
|
-
attr.allocationID of a new Elastic IP created by default
|
|
2999
|
+
- attr.allocationID of a new Elastic IP created by default
|
|
2205
3000
|
//TODO: ADD L2 for elastic ip
|
|
2206
3001
|
|
|
2207
3002
|
:stability: experimental
|
|
@@ -2213,7 +3008,7 @@ class NatGatewayProps:
|
|
|
2213
3008
|
def connectivity_type(self) -> typing.Optional[NatConnectivityType]:
|
|
2214
3009
|
'''(experimental) Indicates whether the NAT gateway supports public or private connectivity.
|
|
2215
3010
|
|
|
2216
|
-
:default:
|
|
3011
|
+
:default: NatConnectivityType.Public
|
|
2217
3012
|
|
|
2218
3013
|
:stability: experimental
|
|
2219
3014
|
'''
|
|
@@ -2224,7 +3019,7 @@ class NatGatewayProps:
|
|
|
2224
3019
|
def max_drain_duration(self) -> typing.Optional[_aws_cdk_ceddda9d.Duration]:
|
|
2225
3020
|
'''(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.
|
|
2226
3021
|
|
|
2227
|
-
:default:
|
|
3022
|
+
:default: 350seconds
|
|
2228
3023
|
|
|
2229
3024
|
:stability: experimental
|
|
2230
3025
|
'''
|
|
@@ -2235,7 +3030,7 @@ class NatGatewayProps:
|
|
|
2235
3030
|
def nat_gateway_name(self) -> typing.Optional[builtins.str]:
|
|
2236
3031
|
'''(experimental) The resource name of the NAT gateway.
|
|
2237
3032
|
|
|
2238
|
-
:default:
|
|
3033
|
+
:default: - NATGW provisioned without any name
|
|
2239
3034
|
|
|
2240
3035
|
:stability: experimental
|
|
2241
3036
|
'''
|
|
@@ -2246,10 +3041,7 @@ class NatGatewayProps:
|
|
|
2246
3041
|
def private_ip_address(self) -> typing.Optional[builtins.str]:
|
|
2247
3042
|
'''(experimental) The private IPv4 address to assign to the NAT gateway.
|
|
2248
3043
|
|
|
2249
|
-
If you don't provide an
|
|
2250
|
-
address, a private IPv4 address will be automatically assigned.
|
|
2251
|
-
|
|
2252
|
-
:default: none
|
|
3044
|
+
:default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
2253
3045
|
|
|
2254
3046
|
:stability: experimental
|
|
2255
3047
|
'''
|
|
@@ -2260,7 +3052,7 @@ class NatGatewayProps:
|
|
|
2260
3052
|
def secondary_allocation_ids(self) -> typing.Optional[typing.List[builtins.str]]:
|
|
2261
3053
|
'''(experimental) Secondary EIP allocation IDs.
|
|
2262
3054
|
|
|
2263
|
-
:default:
|
|
3055
|
+
:default: - no secondary allocation IDs attached to NATGW
|
|
2264
3056
|
|
|
2265
3057
|
:see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
|
|
2266
3058
|
:stability: experimental
|
|
@@ -2275,7 +3067,7 @@ class NatGatewayProps:
|
|
|
2275
3067
|
``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be
|
|
2276
3068
|
set at the same time.
|
|
2277
3069
|
|
|
2278
|
-
:default:
|
|
3070
|
+
:default: - no secondary allocation IDs associated with NATGW
|
|
2279
3071
|
|
|
2280
3072
|
:see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
|
|
2281
3073
|
:stability: experimental
|
|
@@ -2292,7 +3084,7 @@ class NatGatewayProps:
|
|
|
2292
3084
|
``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be
|
|
2293
3085
|
set at the same time.
|
|
2294
3086
|
|
|
2295
|
-
:default:
|
|
3087
|
+
:default: - no secondary private IpAddresses associated with NATGW
|
|
2296
3088
|
|
|
2297
3089
|
:see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
|
|
2298
3090
|
:stability: experimental
|
|
@@ -2304,7 +3096,7 @@ class NatGatewayProps:
|
|
|
2304
3096
|
def vpc(self) -> typing.Optional[IVpcV2]:
|
|
2305
3097
|
'''(experimental) The ID of the VPC in which the NAT gateway is located.
|
|
2306
3098
|
|
|
2307
|
-
:default:
|
|
3099
|
+
:default: - no elastic ip associated, required in case of public connectivity if ``AllocationId`` is not defined
|
|
2308
3100
|
|
|
2309
3101
|
:stability: experimental
|
|
2310
3102
|
'''
|
|
@@ -2347,9 +3139,9 @@ class PoolOptions:
|
|
|
2347
3139
|
'''(experimental) Options for configuring an IPAM pool.
|
|
2348
3140
|
|
|
2349
3141
|
:param address_family: (experimental) addressFamily - The address family of the pool (ipv4 or ipv6).
|
|
2350
|
-
:param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: -
|
|
3142
|
+
:param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - required in case of an IPv6, throws an error if not provided.
|
|
2351
3143
|
:param ipv4_provisioned_cidrs: (experimental) Information about the CIDRs provisioned to the pool. Default: - No CIDRs are provisioned
|
|
2352
|
-
:param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region
|
|
3144
|
+
:param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region of IPAM
|
|
2353
3145
|
:param public_ip_source: (experimental) The IP address source for pools in the public scope. Only used for IPv6 address Only allowed values to this are 'byoip' or 'amazon' Default: amazon
|
|
2354
3146
|
|
|
2355
3147
|
:see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampool.html
|
|
@@ -2363,28 +3155,28 @@ class PoolOptions:
|
|
|
2363
3155
|
operating_region=["us-west-1"]
|
|
2364
3156
|
)
|
|
2365
3157
|
ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
|
|
2366
|
-
address_family=
|
|
3158
|
+
address_family=AddressFamily.IP_V6,
|
|
2367
3159
|
aws_service=AwsServiceName.EC2,
|
|
2368
3160
|
locale="us-west-1",
|
|
2369
|
-
public_ip_source=
|
|
3161
|
+
public_ip_source=IpamPoolPublicIpSource.AMAZON
|
|
2370
3162
|
)
|
|
2371
3163
|
ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
|
|
2372
3164
|
|
|
2373
3165
|
ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
|
|
2374
|
-
address_family=
|
|
3166
|
+
address_family=AddressFamily.IP_V4
|
|
2375
3167
|
)
|
|
2376
3168
|
ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
|
|
2377
3169
|
|
|
2378
|
-
|
|
2379
|
-
primary_address_block=
|
|
3170
|
+
VpcV2(self, "Vpc",
|
|
3171
|
+
primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
|
|
2380
3172
|
secondary_address_blocks=[
|
|
2381
|
-
|
|
2382
|
-
|
|
3173
|
+
IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
|
|
3174
|
+
IpAddresses.ipv6_ipam(
|
|
2383
3175
|
ipam_pool=ipam_public_pool,
|
|
2384
3176
|
netmask_length=52,
|
|
2385
3177
|
cidr_block_name="ipv6Ipam"
|
|
2386
3178
|
),
|
|
2387
|
-
|
|
3179
|
+
IpAddresses.ipv4_ipam(
|
|
2388
3180
|
ipam_pool=ipam_private_pool,
|
|
2389
3181
|
netmask_length=8,
|
|
2390
3182
|
cidr_block_name="ipv4Ipam"
|
|
@@ -2427,7 +3219,7 @@ class PoolOptions:
|
|
|
2427
3219
|
|
|
2428
3220
|
"ec2", for example, allows users to use space for Elastic IP addresses and VPCs.
|
|
2429
3221
|
|
|
2430
|
-
:default: -
|
|
3222
|
+
:default: - required in case of an IPv6, throws an error if not provided.
|
|
2431
3223
|
|
|
2432
3224
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampool.html#cfn-ec2-ipampool-awsservice
|
|
2433
3225
|
:stability: experimental
|
|
@@ -2455,7 +3247,7 @@ class PoolOptions:
|
|
|
2455
3247
|
You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region.
|
|
2456
3248
|
Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error.
|
|
2457
3249
|
|
|
2458
|
-
:default: - Current operating region
|
|
3250
|
+
:default: - Current operating region of IPAM
|
|
2459
3251
|
|
|
2460
3252
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampool.html#cfn-ec2-ipampool-locale
|
|
2461
3253
|
:stability: experimental
|
|
@@ -2503,24 +3295,24 @@ class Route(
|
|
|
2503
3295
|
|
|
2504
3296
|
Example::
|
|
2505
3297
|
|
|
2506
|
-
my_vpc =
|
|
2507
|
-
route_table =
|
|
3298
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
3299
|
+
route_table = RouteTable(self, "RouteTable",
|
|
2508
3300
|
vpc=my_vpc
|
|
2509
3301
|
)
|
|
2510
|
-
subnet =
|
|
3302
|
+
subnet = SubnetV2(self, "Subnet",
|
|
2511
3303
|
vpc=my_vpc,
|
|
2512
3304
|
availability_zone="eu-west-2a",
|
|
2513
3305
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
2514
|
-
subnet_type=
|
|
3306
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
2515
3307
|
)
|
|
2516
3308
|
|
|
2517
|
-
natgw =
|
|
3309
|
+
natgw = NatGateway(self, "NatGW",
|
|
2518
3310
|
subnet=subnet,
|
|
2519
3311
|
vpc=my_vpc,
|
|
2520
3312
|
connectivity_type=NatConnectivityType.PRIVATE,
|
|
2521
3313
|
private_ip_address="10.0.0.42"
|
|
2522
3314
|
)
|
|
2523
|
-
|
|
3315
|
+
Route(self, "NatGwRoute",
|
|
2524
3316
|
route_table=route_table,
|
|
2525
3317
|
destination="0.0.0.0/0",
|
|
2526
3318
|
target={"gateway": natgw}
|
|
@@ -2543,7 +3335,7 @@ class Route(
|
|
|
2543
3335
|
:param destination: (experimental) The IPv4 or IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
|
|
2544
3336
|
:param route_table: (experimental) The ID of the route table for the route.
|
|
2545
3337
|
:param target: (experimental) The gateway or endpoint targeted by the route.
|
|
2546
|
-
:param route_name: (experimental) The resource name of the route. Default:
|
|
3338
|
+
:param route_name: (experimental) The resource name of the route. Default: - provisioned without a route name
|
|
2547
3339
|
|
|
2548
3340
|
:stability: experimental
|
|
2549
3341
|
'''
|
|
@@ -2633,31 +3425,31 @@ class RouteProps:
|
|
|
2633
3425
|
:param destination: (experimental) The IPv4 or IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
|
|
2634
3426
|
:param route_table: (experimental) The ID of the route table for the route.
|
|
2635
3427
|
:param target: (experimental) The gateway or endpoint targeted by the route.
|
|
2636
|
-
:param route_name: (experimental) The resource name of the route. Default:
|
|
3428
|
+
:param route_name: (experimental) The resource name of the route. Default: - provisioned without a route name
|
|
2637
3429
|
|
|
2638
3430
|
:stability: experimental
|
|
2639
3431
|
:exampleMetadata: infused
|
|
2640
3432
|
|
|
2641
3433
|
Example::
|
|
2642
3434
|
|
|
2643
|
-
my_vpc =
|
|
2644
|
-
route_table =
|
|
3435
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
3436
|
+
route_table = RouteTable(self, "RouteTable",
|
|
2645
3437
|
vpc=my_vpc
|
|
2646
3438
|
)
|
|
2647
|
-
subnet =
|
|
3439
|
+
subnet = SubnetV2(self, "Subnet",
|
|
2648
3440
|
vpc=my_vpc,
|
|
2649
3441
|
availability_zone="eu-west-2a",
|
|
2650
3442
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
2651
|
-
subnet_type=
|
|
3443
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
2652
3444
|
)
|
|
2653
3445
|
|
|
2654
|
-
natgw =
|
|
3446
|
+
natgw = NatGateway(self, "NatGW",
|
|
2655
3447
|
subnet=subnet,
|
|
2656
3448
|
vpc=my_vpc,
|
|
2657
3449
|
connectivity_type=NatConnectivityType.PRIVATE,
|
|
2658
3450
|
private_ip_address="10.0.0.42"
|
|
2659
3451
|
)
|
|
2660
|
-
|
|
3452
|
+
Route(self, "NatGwRoute",
|
|
2661
3453
|
route_table=route_table,
|
|
2662
3454
|
destination="0.0.0.0/0",
|
|
2663
3455
|
target={"gateway": natgw}
|
|
@@ -2714,7 +3506,7 @@ class RouteProps:
|
|
|
2714
3506
|
def route_name(self) -> typing.Optional[builtins.str]:
|
|
2715
3507
|
'''(experimental) The resource name of the route.
|
|
2716
3508
|
|
|
2717
|
-
:default:
|
|
3509
|
+
:default: - provisioned without a route name
|
|
2718
3510
|
|
|
2719
3511
|
:stability: experimental
|
|
2720
3512
|
'''
|
|
@@ -2733,7 +3525,7 @@ class RouteProps:
|
|
|
2733
3525
|
)
|
|
2734
3526
|
|
|
2735
3527
|
|
|
2736
|
-
@jsii.implements(_aws_cdk_aws_ec2_ceddda9d.IRouteTable
|
|
3528
|
+
@jsii.implements(_aws_cdk_aws_ec2_ceddda9d.IRouteTable)
|
|
2737
3529
|
class RouteTable(
|
|
2738
3530
|
_aws_cdk_ceddda9d.Resource,
|
|
2739
3531
|
metaclass=jsii.JSIIMeta,
|
|
@@ -2748,24 +3540,20 @@ class RouteTable(
|
|
|
2748
3540
|
Example::
|
|
2749
3541
|
|
|
2750
3542
|
stack = Stack()
|
|
2751
|
-
my_vpc =
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
subnet = vpc_v2.SubnetV2(self, "Subnet",
|
|
2756
|
-
vpc=my_vpc,
|
|
2757
|
-
availability_zone="eu-west-2a",
|
|
2758
|
-
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
2759
|
-
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
|
|
3543
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
3544
|
+
vpn_gateway = my_vpc.enable_vpn_gateway_v2(
|
|
3545
|
+
vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
|
|
3546
|
+
type=VpnConnectionType.IPSEC_1
|
|
2760
3547
|
)
|
|
2761
3548
|
|
|
2762
|
-
|
|
3549
|
+
route_table = RouteTable(stack, "routeTable",
|
|
2763
3550
|
vpc=my_vpc
|
|
2764
3551
|
)
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
destination="
|
|
2768
|
-
target={"gateway":
|
|
3552
|
+
|
|
3553
|
+
Route(stack, "route",
|
|
3554
|
+
destination="172.31.0.0/24",
|
|
3555
|
+
target={"gateway": vpn_gateway},
|
|
3556
|
+
route_table=route_table
|
|
2769
3557
|
)
|
|
2770
3558
|
'''
|
|
2771
3559
|
|
|
@@ -2781,7 +3569,7 @@ class RouteTable(
|
|
|
2781
3569
|
:param scope: -
|
|
2782
3570
|
:param id: -
|
|
2783
3571
|
:param vpc: (experimental) The ID of the VPC.
|
|
2784
|
-
:param route_table_name: (experimental) The resource name of the route table. Default:
|
|
3572
|
+
:param route_table_name: (experimental) The resource name of the route table. Default: - provisioned without a route table name
|
|
2785
3573
|
|
|
2786
3574
|
:stability: experimental
|
|
2787
3575
|
'''
|
|
@@ -2793,6 +3581,28 @@ class RouteTable(
|
|
|
2793
3581
|
|
|
2794
3582
|
jsii.create(self.__class__, self, [scope, id, props])
|
|
2795
3583
|
|
|
3584
|
+
@jsii.member(jsii_name="addRoute")
|
|
3585
|
+
def add_route(
|
|
3586
|
+
self,
|
|
3587
|
+
id: builtins.str,
|
|
3588
|
+
destination: builtins.str,
|
|
3589
|
+
target: "RouteTargetType",
|
|
3590
|
+
) -> None:
|
|
3591
|
+
'''(experimental) Adds a new custom route to the route table.
|
|
3592
|
+
|
|
3593
|
+
:param id: -
|
|
3594
|
+
:param destination: The IPv4 or IPv6 CIDR block used for the destination match.
|
|
3595
|
+
:param target: The gateway or endpoint targeted by the route.
|
|
3596
|
+
|
|
3597
|
+
:stability: experimental
|
|
3598
|
+
'''
|
|
3599
|
+
if __debug__:
|
|
3600
|
+
type_hints = typing.get_type_hints(_typecheckingstub__920d6a12797cd2ad571157da68e37100c7d72b72ff09fd42451a65b73f154dd0)
|
|
3601
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
3602
|
+
check_type(argname="argument destination", value=destination, expected_type=type_hints["destination"])
|
|
3603
|
+
check_type(argname="argument target", value=target, expected_type=type_hints["target"])
|
|
3604
|
+
return typing.cast(None, jsii.invoke(self, "addRoute", [id, destination, target]))
|
|
3605
|
+
|
|
2796
3606
|
@builtins.property
|
|
2797
3607
|
@jsii.member(jsii_name="resource")
|
|
2798
3608
|
def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnRouteTable:
|
|
@@ -2827,7 +3637,7 @@ class RouteTableProps:
|
|
|
2827
3637
|
'''(experimental) Properties to define a route table.
|
|
2828
3638
|
|
|
2829
3639
|
:param vpc: (experimental) The ID of the VPC.
|
|
2830
|
-
:param route_table_name: (experimental) The resource name of the route table. Default:
|
|
3640
|
+
:param route_table_name: (experimental) The resource name of the route table. Default: - provisioned without a route table name
|
|
2831
3641
|
|
|
2832
3642
|
:stability: experimental
|
|
2833
3643
|
:exampleMetadata: infused
|
|
@@ -2835,24 +3645,20 @@ class RouteTableProps:
|
|
|
2835
3645
|
Example::
|
|
2836
3646
|
|
|
2837
3647
|
stack = Stack()
|
|
2838
|
-
my_vpc =
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
subnet = vpc_v2.SubnetV2(self, "Subnet",
|
|
2843
|
-
vpc=my_vpc,
|
|
2844
|
-
availability_zone="eu-west-2a",
|
|
2845
|
-
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
2846
|
-
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
|
|
3648
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
3649
|
+
vpn_gateway = my_vpc.enable_vpn_gateway_v2(
|
|
3650
|
+
vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
|
|
3651
|
+
type=VpnConnectionType.IPSEC_1
|
|
2847
3652
|
)
|
|
2848
3653
|
|
|
2849
|
-
|
|
3654
|
+
route_table = RouteTable(stack, "routeTable",
|
|
2850
3655
|
vpc=my_vpc
|
|
2851
3656
|
)
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
destination="
|
|
2855
|
-
target={"gateway":
|
|
3657
|
+
|
|
3658
|
+
Route(stack, "route",
|
|
3659
|
+
destination="172.31.0.0/24",
|
|
3660
|
+
target={"gateway": vpn_gateway},
|
|
3661
|
+
route_table=route_table
|
|
2856
3662
|
)
|
|
2857
3663
|
'''
|
|
2858
3664
|
if __debug__:
|
|
@@ -2879,7 +3685,7 @@ class RouteTableProps:
|
|
|
2879
3685
|
def route_table_name(self) -> typing.Optional[builtins.str]:
|
|
2880
3686
|
'''(experimental) The resource name of the route table.
|
|
2881
3687
|
|
|
2882
|
-
:default:
|
|
3688
|
+
:default: - provisioned without a route table name
|
|
2883
3689
|
|
|
2884
3690
|
:stability: experimental
|
|
2885
3691
|
'''
|
|
@@ -2912,8 +3718,8 @@ class RouteTargetProps:
|
|
|
2912
3718
|
) -> None:
|
|
2913
3719
|
'''(experimental) The type of endpoint or gateway being targeted by the route.
|
|
2914
3720
|
|
|
2915
|
-
:param endpoint: (experimental) The endpoint route target. This is used for targets such as VPC endpoints. Default:
|
|
2916
|
-
:param gateway: (experimental) The gateway route target. This is used for targets such as egress-only internet gateway or VPC peering connection. Default:
|
|
3721
|
+
:param endpoint: (experimental) The endpoint route target. This is used for targets such as VPC endpoints. Default: - target is not set to an endpoint, in this case a gateway is needed.
|
|
3722
|
+
:param gateway: (experimental) The gateway route target. This is used for targets such as egress-only internet gateway or VPC peering connection. Default: - target is not set to a gateway, in this case an endpoint is needed.
|
|
2917
3723
|
|
|
2918
3724
|
:stability: experimental
|
|
2919
3725
|
:exampleMetadata: fixture=_generated
|
|
@@ -2950,7 +3756,7 @@ class RouteTargetProps:
|
|
|
2950
3756
|
This is used for targets such as
|
|
2951
3757
|
VPC endpoints.
|
|
2952
3758
|
|
|
2953
|
-
:default:
|
|
3759
|
+
:default: - target is not set to an endpoint, in this case a gateway is needed.
|
|
2954
3760
|
|
|
2955
3761
|
:stability: experimental
|
|
2956
3762
|
'''
|
|
@@ -2964,7 +3770,7 @@ class RouteTargetProps:
|
|
|
2964
3770
|
This is used for targets such as
|
|
2965
3771
|
egress-only internet gateway or VPC peering connection.
|
|
2966
3772
|
|
|
2967
|
-
:default:
|
|
3773
|
+
:default: - target is not set to a gateway, in this case an endpoint is needed.
|
|
2968
3774
|
|
|
2969
3775
|
:stability: experimental
|
|
2970
3776
|
'''
|
|
@@ -2994,27 +3800,25 @@ class RouteTargetType(
|
|
|
2994
3800
|
|
|
2995
3801
|
Example::
|
|
2996
3802
|
|
|
2997
|
-
|
|
2998
|
-
|
|
3803
|
+
stack = Stack()
|
|
3804
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
3805
|
+
route_table = RouteTable(self, "RouteTable",
|
|
2999
3806
|
vpc=my_vpc
|
|
3000
3807
|
)
|
|
3001
|
-
subnet =
|
|
3808
|
+
subnet = SubnetV2(self, "Subnet",
|
|
3002
3809
|
vpc=my_vpc,
|
|
3003
3810
|
availability_zone="eu-west-2a",
|
|
3004
3811
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
3005
|
-
subnet_type=
|
|
3812
|
+
subnet_type=SubnetType.PRIVATE_ISOLATED
|
|
3006
3813
|
)
|
|
3007
3814
|
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
vpc=my_vpc,
|
|
3011
|
-
connectivity_type=NatConnectivityType.PRIVATE,
|
|
3012
|
-
private_ip_address="10.0.0.42"
|
|
3815
|
+
igw = InternetGateway(self, "IGW",
|
|
3816
|
+
vpc=my_vpc
|
|
3013
3817
|
)
|
|
3014
|
-
|
|
3818
|
+
Route(self, "IgwRoute",
|
|
3015
3819
|
route_table=route_table,
|
|
3016
3820
|
destination="0.0.0.0/0",
|
|
3017
|
-
target={"gateway":
|
|
3821
|
+
target={"gateway": igw}
|
|
3018
3822
|
)
|
|
3019
3823
|
'''
|
|
3020
3824
|
|
|
@@ -3025,8 +3829,8 @@ class RouteTargetType(
|
|
|
3025
3829
|
gateway: typing.Optional[IRouteTarget] = None,
|
|
3026
3830
|
) -> None:
|
|
3027
3831
|
'''
|
|
3028
|
-
:param endpoint: (experimental) The endpoint route target. This is used for targets such as VPC endpoints. Default:
|
|
3029
|
-
:param gateway: (experimental) The gateway route target. This is used for targets such as egress-only internet gateway or VPC peering connection. Default:
|
|
3832
|
+
:param endpoint: (experimental) The endpoint route target. This is used for targets such as VPC endpoints. Default: - target is not set to an endpoint, in this case a gateway is needed.
|
|
3833
|
+
:param gateway: (experimental) The gateway route target. This is used for targets such as egress-only internet gateway or VPC peering connection. Default: - target is not set to a gateway, in this case an endpoint is needed.
|
|
3030
3834
|
|
|
3031
3835
|
:stability: experimental
|
|
3032
3836
|
'''
|
|
@@ -3042,7 +3846,7 @@ class RouteTargetType(
|
|
|
3042
3846
|
This is used for targets such as
|
|
3043
3847
|
VPC endpoints.
|
|
3044
3848
|
|
|
3045
|
-
:default:
|
|
3849
|
+
:default: - target is not set to an endpoint, in this case a gateway is needed.
|
|
3046
3850
|
|
|
3047
3851
|
:stability: experimental
|
|
3048
3852
|
'''
|
|
@@ -3056,7 +3860,7 @@ class RouteTargetType(
|
|
|
3056
3860
|
This is used for targets such as
|
|
3057
3861
|
egress-only internet gateway or VPC peering connection.
|
|
3058
3862
|
|
|
3059
|
-
:default:
|
|
3863
|
+
:default: - target is not set to a gateway, in this case an endpoint is needed.
|
|
3060
3864
|
|
|
3061
3865
|
:stability: experimental
|
|
3062
3866
|
'''
|
|
@@ -3080,19 +3884,22 @@ class SecondaryAddressProps:
|
|
|
3080
3884
|
Example::
|
|
3081
3885
|
|
|
3082
3886
|
stack = Stack()
|
|
3083
|
-
my_vpc =
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3887
|
+
my_vpc = VpcV2(self, "Vpc",
|
|
3888
|
+
primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
|
|
3889
|
+
secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
|
|
3890
|
+
cidr_block_name="AmazonProvided"
|
|
3891
|
+
)]
|
|
3087
3892
|
)
|
|
3088
3893
|
|
|
3089
|
-
|
|
3090
|
-
vpc=my_vpc
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3894
|
+
eigw = EgressOnlyInternetGateway(self, "EIGW",
|
|
3895
|
+
vpc=my_vpc
|
|
3896
|
+
)
|
|
3897
|
+
|
|
3898
|
+
route_table = RouteTable(self, "RouteTable",
|
|
3899
|
+
vpc=my_vpc
|
|
3095
3900
|
)
|
|
3901
|
+
|
|
3902
|
+
route_table.add_route("EIGW", "::/0", {"gateway": eigw})
|
|
3096
3903
|
'''
|
|
3097
3904
|
if __debug__:
|
|
3098
3905
|
type_hints = typing.get_type_hints(_typecheckingstub__9433843cde495b2d9551feec9fd15a488c151e944cfd2262b5fc2613ca397870)
|
|
@@ -3144,24 +3951,21 @@ class SubnetV2(
|
|
|
3144
3951
|
Example::
|
|
3145
3952
|
|
|
3146
3953
|
stack = Stack()
|
|
3147
|
-
my_vpc =
|
|
3148
|
-
route_table =
|
|
3954
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
3955
|
+
route_table = RouteTable(self, "RouteTable",
|
|
3149
3956
|
vpc=my_vpc
|
|
3150
3957
|
)
|
|
3151
|
-
subnet =
|
|
3958
|
+
subnet = SubnetV2(self, "Subnet",
|
|
3152
3959
|
vpc=my_vpc,
|
|
3153
3960
|
availability_zone="eu-west-2a",
|
|
3154
3961
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
3155
|
-
subnet_type=
|
|
3962
|
+
subnet_type=SubnetType.PUBLIC
|
|
3156
3963
|
)
|
|
3157
3964
|
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
route_table=route_table,
|
|
3163
|
-
destination="0.0.0.0/0",
|
|
3164
|
-
target={"gateway": igw}
|
|
3965
|
+
my_vpc.add_internet_gateway()
|
|
3966
|
+
my_vpc.add_nat_gateway(
|
|
3967
|
+
subnet=subnet,
|
|
3968
|
+
connectivity_type=NatConnectivityType.PUBLIC
|
|
3165
3969
|
)
|
|
3166
3970
|
'''
|
|
3167
3971
|
|
|
@@ -3187,10 +3991,10 @@ class SubnetV2(
|
|
|
3187
3991
|
:param ipv4_cidr_block: (experimental) ipv4 cidr to assign to this subnet. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-cidrblock
|
|
3188
3992
|
:param subnet_type: (experimental) The type of Subnet to configure. The Subnet type will control the ability to route and connect to the Internet. TODO: Add validation check ``subnetType`` when adding resources (e.g. cannot add NatGateway to private)
|
|
3189
3993
|
:param vpc: (experimental) VPC Prop.
|
|
3190
|
-
:param assign_ipv6_address_on_creation: (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock. Default:
|
|
3191
|
-
:param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: No Ipv6 address
|
|
3192
|
-
:param route_table: (experimental) Custom Route for subnet. Default:
|
|
3193
|
-
:param subnet_name: (experimental) Subnet name. Default:
|
|
3994
|
+
:param assign_ipv6_address_on_creation: (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock. Default: - undefined in case not provided as an input
|
|
3995
|
+
:param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: - No Ipv6 address
|
|
3996
|
+
:param route_table: (experimental) Custom Route for subnet. Default: - a default route table created
|
|
3997
|
+
:param subnet_name: (experimental) Subnet name. Default: - provisioned with an autogenerated name by CDK
|
|
3194
3998
|
|
|
3195
3999
|
:stability: experimental
|
|
3196
4000
|
'''
|
|
@@ -3269,7 +4073,7 @@ class SubnetV2(
|
|
|
3269
4073
|
@builtins.property
|
|
3270
4074
|
@jsii.member(jsii_name="routeTable")
|
|
3271
4075
|
def route_table(self) -> _aws_cdk_aws_ec2_ceddda9d.IRouteTable:
|
|
3272
|
-
'''(experimental)
|
|
4076
|
+
'''(experimental) Return the Route Table associated with this subnet.
|
|
3273
4077
|
|
|
3274
4078
|
:stability: experimental
|
|
3275
4079
|
'''
|
|
@@ -3286,23 +4090,23 @@ class SubnetV2(
|
|
|
3286
4090
|
return typing.cast(builtins.str, jsii.get(self, "subnetId"))
|
|
3287
4091
|
|
|
3288
4092
|
@builtins.property
|
|
3289
|
-
@jsii.member(jsii_name="
|
|
3290
|
-
def
|
|
3291
|
-
'''(experimental) The
|
|
4093
|
+
@jsii.member(jsii_name="ipv6CidrBlock")
|
|
4094
|
+
def ipv6_cidr_block(self) -> typing.Optional[builtins.str]:
|
|
4095
|
+
'''(experimental) The IPv6 CIDR Block for this subnet.
|
|
3292
4096
|
|
|
3293
4097
|
:stability: experimental
|
|
3294
|
-
:attribute: SubnetType
|
|
3295
4098
|
'''
|
|
3296
|
-
return typing.cast(
|
|
4099
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "ipv6CidrBlock"))
|
|
3297
4100
|
|
|
3298
4101
|
@builtins.property
|
|
3299
|
-
@jsii.member(jsii_name="
|
|
3300
|
-
def
|
|
3301
|
-
'''(experimental) The
|
|
4102
|
+
@jsii.member(jsii_name="subnetType")
|
|
4103
|
+
def subnet_type(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType]:
|
|
4104
|
+
'''(experimental) The type of subnet (public or private) that this subnet represents.
|
|
3302
4105
|
|
|
3303
4106
|
:stability: experimental
|
|
4107
|
+
:attribute: SubnetType
|
|
3304
4108
|
'''
|
|
3305
|
-
return typing.cast(typing.Optional[
|
|
4109
|
+
return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType], jsii.get(self, "subnetType"))
|
|
3306
4110
|
|
|
3307
4111
|
|
|
3308
4112
|
@jsii.data_type(
|
|
@@ -3338,10 +4142,10 @@ class SubnetV2Props:
|
|
|
3338
4142
|
:param ipv4_cidr_block: (experimental) ipv4 cidr to assign to this subnet. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-cidrblock
|
|
3339
4143
|
:param subnet_type: (experimental) The type of Subnet to configure. The Subnet type will control the ability to route and connect to the Internet. TODO: Add validation check ``subnetType`` when adding resources (e.g. cannot add NatGateway to private)
|
|
3340
4144
|
:param vpc: (experimental) VPC Prop.
|
|
3341
|
-
:param assign_ipv6_address_on_creation: (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock. Default:
|
|
3342
|
-
:param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: No Ipv6 address
|
|
3343
|
-
:param route_table: (experimental) Custom Route for subnet. Default:
|
|
3344
|
-
:param subnet_name: (experimental) Subnet name. Default:
|
|
4145
|
+
:param assign_ipv6_address_on_creation: (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock. Default: - undefined in case not provided as an input
|
|
4146
|
+
:param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: - No Ipv6 address
|
|
4147
|
+
:param route_table: (experimental) Custom Route for subnet. Default: - a default route table created
|
|
4148
|
+
:param subnet_name: (experimental) Subnet name. Default: - provisioned with an autogenerated name by CDK
|
|
3345
4149
|
|
|
3346
4150
|
:stability: experimental
|
|
3347
4151
|
:exampleMetadata: infused
|
|
@@ -3349,24 +4153,21 @@ class SubnetV2Props:
|
|
|
3349
4153
|
Example::
|
|
3350
4154
|
|
|
3351
4155
|
stack = Stack()
|
|
3352
|
-
my_vpc =
|
|
3353
|
-
route_table =
|
|
4156
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
4157
|
+
route_table = RouteTable(self, "RouteTable",
|
|
3354
4158
|
vpc=my_vpc
|
|
3355
4159
|
)
|
|
3356
|
-
subnet =
|
|
4160
|
+
subnet = SubnetV2(self, "Subnet",
|
|
3357
4161
|
vpc=my_vpc,
|
|
3358
4162
|
availability_zone="eu-west-2a",
|
|
3359
4163
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
3360
|
-
subnet_type=
|
|
4164
|
+
subnet_type=SubnetType.PUBLIC
|
|
3361
4165
|
)
|
|
3362
4166
|
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
route_table=route_table,
|
|
3368
|
-
destination="0.0.0.0/0",
|
|
3369
|
-
target={"gateway": igw}
|
|
4167
|
+
my_vpc.add_internet_gateway()
|
|
4168
|
+
my_vpc.add_nat_gateway(
|
|
4169
|
+
subnet=subnet,
|
|
4170
|
+
connectivity_type=NatConnectivityType.PUBLIC
|
|
3370
4171
|
)
|
|
3371
4172
|
'''
|
|
3372
4173
|
if __debug__:
|
|
@@ -3447,7 +4248,7 @@ class SubnetV2Props:
|
|
|
3447
4248
|
|
|
3448
4249
|
If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
|
|
3449
4250
|
|
|
3450
|
-
:default:
|
|
4251
|
+
:default: - undefined in case not provided as an input
|
|
3451
4252
|
|
|
3452
4253
|
:stability: experimental
|
|
3453
4254
|
'''
|
|
@@ -3458,7 +4259,7 @@ class SubnetV2Props:
|
|
|
3458
4259
|
def ipv6_cidr_block(self) -> typing.Optional[IpCidr]:
|
|
3459
4260
|
'''(experimental) Ipv6 CIDR Range for subnet.
|
|
3460
4261
|
|
|
3461
|
-
:default: No Ipv6 address
|
|
4262
|
+
:default: - No Ipv6 address
|
|
3462
4263
|
|
|
3463
4264
|
:stability: experimental
|
|
3464
4265
|
'''
|
|
@@ -3469,7 +4270,7 @@ class SubnetV2Props:
|
|
|
3469
4270
|
def route_table(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IRouteTable]:
|
|
3470
4271
|
'''(experimental) Custom Route for subnet.
|
|
3471
4272
|
|
|
3472
|
-
:default:
|
|
4273
|
+
:default: - a default route table created
|
|
3473
4274
|
|
|
3474
4275
|
:stability: experimental
|
|
3475
4276
|
'''
|
|
@@ -3480,7 +4281,7 @@ class SubnetV2Props:
|
|
|
3480
4281
|
def subnet_name(self) -> typing.Optional[builtins.str]:
|
|
3481
4282
|
'''(experimental) Subnet name.
|
|
3482
4283
|
|
|
3483
|
-
:default:
|
|
4284
|
+
:default: - provisioned with an autogenerated name by CDK
|
|
3484
4285
|
|
|
3485
4286
|
:stability: experimental
|
|
3486
4287
|
'''
|
|
@@ -3500,33 +4301,34 @@ class SubnetV2Props:
|
|
|
3500
4301
|
|
|
3501
4302
|
|
|
3502
4303
|
@jsii.implements(IRouteTarget)
|
|
3503
|
-
class
|
|
4304
|
+
class VPNGatewayV2(
|
|
3504
4305
|
_aws_cdk_ceddda9d.Resource,
|
|
3505
4306
|
metaclass=jsii.JSIIMeta,
|
|
3506
|
-
jsii_type="@aws-cdk/aws-ec2-alpha.
|
|
4307
|
+
jsii_type="@aws-cdk/aws-ec2-alpha.VPNGatewayV2",
|
|
3507
4308
|
):
|
|
3508
4309
|
'''(experimental) Creates a virtual private gateway.
|
|
3509
4310
|
|
|
3510
4311
|
:stability: experimental
|
|
3511
4312
|
:resource: AWS::EC2::VPNGateway
|
|
3512
|
-
:exampleMetadata:
|
|
4313
|
+
:exampleMetadata: infused
|
|
3513
4314
|
|
|
3514
4315
|
Example::
|
|
3515
4316
|
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
4317
|
+
stack = Stack()
|
|
4318
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
4319
|
+
vpn_gateway = my_vpc.enable_vpn_gateway_v2(
|
|
4320
|
+
vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
|
|
4321
|
+
type=VpnConnectionType.IPSEC_1
|
|
4322
|
+
)
|
|
3522
4323
|
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
4324
|
+
route_table = RouteTable(stack, "routeTable",
|
|
4325
|
+
vpc=my_vpc
|
|
4326
|
+
)
|
|
3526
4327
|
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
4328
|
+
Route(stack, "route",
|
|
4329
|
+
destination="172.31.0.0/24",
|
|
4330
|
+
target={"gateway": vpn_gateway},
|
|
4331
|
+
route_table=route_table
|
|
3530
4332
|
)
|
|
3531
4333
|
'''
|
|
3532
4334
|
|
|
@@ -3535,96 +4337,224 @@ class VPNGateway(
|
|
|
3535
4337
|
scope: _constructs_77d1e7e8.Construct,
|
|
3536
4338
|
id: builtins.str,
|
|
3537
4339
|
*,
|
|
3538
|
-
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
3539
4340
|
vpc: IVpcV2,
|
|
4341
|
+
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
3540
4342
|
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
3541
4343
|
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
4344
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
3542
4345
|
) -> None:
|
|
3543
4346
|
'''
|
|
3544
4347
|
:param scope: -
|
|
3545
4348
|
:param id: -
|
|
3546
|
-
:param type: (experimental) The type of VPN connection the virtual private gateway supports.
|
|
3547
4349
|
:param vpc: (experimental) The ID of the VPC for which to create the VPN gateway.
|
|
3548
|
-
:param
|
|
3549
|
-
:param
|
|
4350
|
+
:param type: (experimental) The type of VPN connection the virtual private gateway supports.
|
|
4351
|
+
:param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
|
|
4352
|
+
:param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
|
|
4353
|
+
:param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
|
|
3550
4354
|
|
|
3551
4355
|
:stability: experimental
|
|
3552
4356
|
'''
|
|
3553
4357
|
if __debug__:
|
|
3554
|
-
type_hints = typing.get_type_hints(
|
|
4358
|
+
type_hints = typing.get_type_hints(_typecheckingstub__99ebb03388deee94929850a6302ea70455c70b08fdbc048c0ad431df4f5d7bff)
|
|
3555
4359
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
3556
4360
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
3557
|
-
props =
|
|
3558
|
-
type=type,
|
|
4361
|
+
props = VPNGatewayV2Props(
|
|
3559
4362
|
vpc=vpc,
|
|
4363
|
+
type=type,
|
|
3560
4364
|
amazon_side_asn=amazon_side_asn,
|
|
3561
4365
|
vpn_gateway_name=vpn_gateway_name,
|
|
4366
|
+
vpn_route_propagation=vpn_route_propagation,
|
|
3562
4367
|
)
|
|
3563
4368
|
|
|
3564
4369
|
jsii.create(self.__class__, self, [scope, id, props])
|
|
3565
4370
|
|
|
3566
4371
|
@builtins.property
|
|
3567
|
-
@jsii.member(jsii_name="resource")
|
|
3568
|
-
def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnVPNGateway:
|
|
3569
|
-
'''(experimental) The VPN gateway CFN resource.
|
|
4372
|
+
@jsii.member(jsii_name="resource")
|
|
4373
|
+
def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnVPNGateway:
|
|
4374
|
+
'''(experimental) The VPN gateway CFN resource.
|
|
4375
|
+
|
|
4376
|
+
:stability: experimental
|
|
4377
|
+
'''
|
|
4378
|
+
return typing.cast(_aws_cdk_aws_ec2_ceddda9d.CfnVPNGateway, jsii.get(self, "resource"))
|
|
4379
|
+
|
|
4380
|
+
@builtins.property
|
|
4381
|
+
@jsii.member(jsii_name="routerTargetId")
|
|
4382
|
+
def router_target_id(self) -> builtins.str:
|
|
4383
|
+
'''(experimental) The ID of the route target.
|
|
4384
|
+
|
|
4385
|
+
:stability: experimental
|
|
4386
|
+
'''
|
|
4387
|
+
return typing.cast(builtins.str, jsii.get(self, "routerTargetId"))
|
|
4388
|
+
|
|
4389
|
+
@builtins.property
|
|
4390
|
+
@jsii.member(jsii_name="routerType")
|
|
4391
|
+
def router_type(self) -> _aws_cdk_aws_ec2_ceddda9d.RouterType:
|
|
4392
|
+
'''(experimental) The type of router used in the route.
|
|
4393
|
+
|
|
4394
|
+
:stability: experimental
|
|
4395
|
+
'''
|
|
4396
|
+
return typing.cast(_aws_cdk_aws_ec2_ceddda9d.RouterType, jsii.get(self, "routerType"))
|
|
4397
|
+
|
|
4398
|
+
@builtins.property
|
|
4399
|
+
@jsii.member(jsii_name="vpcId")
|
|
4400
|
+
def vpc_id(self) -> builtins.str:
|
|
4401
|
+
'''(experimental) The ID of the VPC for which to create the VPN gateway.
|
|
4402
|
+
|
|
4403
|
+
:stability: experimental
|
|
4404
|
+
'''
|
|
4405
|
+
return typing.cast(builtins.str, jsii.get(self, "vpcId"))
|
|
4406
|
+
|
|
4407
|
+
|
|
4408
|
+
@jsii.data_type(
|
|
4409
|
+
jsii_type="@aws-cdk/aws-ec2-alpha.VPNGatewayV2Options",
|
|
4410
|
+
jsii_struct_bases=[],
|
|
4411
|
+
name_mapping={
|
|
4412
|
+
"type": "type",
|
|
4413
|
+
"amazon_side_asn": "amazonSideAsn",
|
|
4414
|
+
"vpn_gateway_name": "vpnGatewayName",
|
|
4415
|
+
"vpn_route_propagation": "vpnRoutePropagation",
|
|
4416
|
+
},
|
|
4417
|
+
)
|
|
4418
|
+
class VPNGatewayV2Options:
|
|
4419
|
+
def __init__(
|
|
4420
|
+
self,
|
|
4421
|
+
*,
|
|
4422
|
+
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
4423
|
+
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
4424
|
+
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
4425
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4426
|
+
) -> None:
|
|
4427
|
+
'''(experimental) Options to define VPNGatewayV2 for VPC.
|
|
4428
|
+
|
|
4429
|
+
:param type: (experimental) The type of VPN connection the virtual private gateway supports.
|
|
4430
|
+
:param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
|
|
4431
|
+
:param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
|
|
4432
|
+
:param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
|
|
4433
|
+
|
|
4434
|
+
:stability: experimental
|
|
4435
|
+
:exampleMetadata: infused
|
|
4436
|
+
|
|
4437
|
+
Example::
|
|
4438
|
+
|
|
4439
|
+
stack = Stack()
|
|
4440
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
4441
|
+
vpn_gateway = my_vpc.enable_vpn_gateway_v2(
|
|
4442
|
+
vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
|
|
4443
|
+
type=VpnConnectionType.IPSEC_1
|
|
4444
|
+
)
|
|
4445
|
+
|
|
4446
|
+
route_table = RouteTable(stack, "routeTable",
|
|
4447
|
+
vpc=my_vpc
|
|
4448
|
+
)
|
|
4449
|
+
|
|
4450
|
+
Route(stack, "route",
|
|
4451
|
+
destination="172.31.0.0/24",
|
|
4452
|
+
target={"gateway": vpn_gateway},
|
|
4453
|
+
route_table=route_table
|
|
4454
|
+
)
|
|
4455
|
+
'''
|
|
4456
|
+
if __debug__:
|
|
4457
|
+
type_hints = typing.get_type_hints(_typecheckingstub__e29191c56c11acb8fa2ca10b1e81f7c86e1e7ca21a360a0f41a7a6ec64c967c8)
|
|
4458
|
+
check_type(argname="argument type", value=type, expected_type=type_hints["type"])
|
|
4459
|
+
check_type(argname="argument amazon_side_asn", value=amazon_side_asn, expected_type=type_hints["amazon_side_asn"])
|
|
4460
|
+
check_type(argname="argument vpn_gateway_name", value=vpn_gateway_name, expected_type=type_hints["vpn_gateway_name"])
|
|
4461
|
+
check_type(argname="argument vpn_route_propagation", value=vpn_route_propagation, expected_type=type_hints["vpn_route_propagation"])
|
|
4462
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
4463
|
+
"type": type,
|
|
4464
|
+
}
|
|
4465
|
+
if amazon_side_asn is not None:
|
|
4466
|
+
self._values["amazon_side_asn"] = amazon_side_asn
|
|
4467
|
+
if vpn_gateway_name is not None:
|
|
4468
|
+
self._values["vpn_gateway_name"] = vpn_gateway_name
|
|
4469
|
+
if vpn_route_propagation is not None:
|
|
4470
|
+
self._values["vpn_route_propagation"] = vpn_route_propagation
|
|
4471
|
+
|
|
4472
|
+
@builtins.property
|
|
4473
|
+
def type(self) -> _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType:
|
|
4474
|
+
'''(experimental) The type of VPN connection the virtual private gateway supports.
|
|
3570
4475
|
|
|
4476
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpngateway.html#cfn-ec2-vpngateway-type
|
|
3571
4477
|
:stability: experimental
|
|
3572
4478
|
'''
|
|
3573
|
-
|
|
4479
|
+
result = self._values.get("type")
|
|
4480
|
+
assert result is not None, "Required property 'type' is missing"
|
|
4481
|
+
return typing.cast(_aws_cdk_aws_ec2_ceddda9d.VpnConnectionType, result)
|
|
3574
4482
|
|
|
3575
4483
|
@builtins.property
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
4484
|
+
def amazon_side_asn(self) -> typing.Optional[jsii.Number]:
|
|
4485
|
+
'''(experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
|
|
4486
|
+
|
|
4487
|
+
:default: - no ASN set for BGP session
|
|
3579
4488
|
|
|
3580
4489
|
:stability: experimental
|
|
3581
4490
|
'''
|
|
3582
|
-
|
|
4491
|
+
result = self._values.get("amazon_side_asn")
|
|
4492
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
3583
4493
|
|
|
3584
4494
|
@builtins.property
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
4495
|
+
def vpn_gateway_name(self) -> typing.Optional[builtins.str]:
|
|
4496
|
+
'''(experimental) The resource name of the VPN gateway.
|
|
4497
|
+
|
|
4498
|
+
:default: - resource provisioned without any name
|
|
3588
4499
|
|
|
3589
4500
|
:stability: experimental
|
|
3590
4501
|
'''
|
|
3591
|
-
|
|
4502
|
+
result = self._values.get("vpn_gateway_name")
|
|
4503
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
3592
4504
|
|
|
3593
4505
|
@builtins.property
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
4506
|
+
def vpn_route_propagation(
|
|
4507
|
+
self,
|
|
4508
|
+
) -> typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]]:
|
|
4509
|
+
'''(experimental) Subnets where the route propagation should be added.
|
|
4510
|
+
|
|
4511
|
+
:default: - no propogation for routes
|
|
3597
4512
|
|
|
3598
4513
|
:stability: experimental
|
|
3599
4514
|
'''
|
|
3600
|
-
|
|
4515
|
+
result = self._values.get("vpn_route_propagation")
|
|
4516
|
+
return typing.cast(typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]], result)
|
|
4517
|
+
|
|
4518
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
4519
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
4520
|
+
|
|
4521
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
4522
|
+
return not (rhs == self)
|
|
4523
|
+
|
|
4524
|
+
def __repr__(self) -> str:
|
|
4525
|
+
return "VPNGatewayV2Options(%s)" % ", ".join(
|
|
4526
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
4527
|
+
)
|
|
3601
4528
|
|
|
3602
4529
|
|
|
3603
4530
|
@jsii.data_type(
|
|
3604
|
-
jsii_type="@aws-cdk/aws-ec2-alpha.
|
|
3605
|
-
jsii_struct_bases=[],
|
|
4531
|
+
jsii_type="@aws-cdk/aws-ec2-alpha.VPNGatewayV2Props",
|
|
4532
|
+
jsii_struct_bases=[VPNGatewayV2Options],
|
|
3606
4533
|
name_mapping={
|
|
3607
4534
|
"type": "type",
|
|
3608
|
-
"vpc": "vpc",
|
|
3609
4535
|
"amazon_side_asn": "amazonSideAsn",
|
|
3610
4536
|
"vpn_gateway_name": "vpnGatewayName",
|
|
4537
|
+
"vpn_route_propagation": "vpnRoutePropagation",
|
|
4538
|
+
"vpc": "vpc",
|
|
3611
4539
|
},
|
|
3612
4540
|
)
|
|
3613
|
-
class
|
|
4541
|
+
class VPNGatewayV2Props(VPNGatewayV2Options):
|
|
3614
4542
|
def __init__(
|
|
3615
4543
|
self,
|
|
3616
4544
|
*,
|
|
3617
4545
|
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
3618
|
-
vpc: IVpcV2,
|
|
3619
4546
|
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
3620
4547
|
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
4548
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4549
|
+
vpc: IVpcV2,
|
|
3621
4550
|
) -> None:
|
|
3622
4551
|
'''(experimental) Properties to define a VPN gateway.
|
|
3623
4552
|
|
|
3624
4553
|
:param type: (experimental) The type of VPN connection the virtual private gateway supports.
|
|
4554
|
+
:param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
|
|
4555
|
+
:param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
|
|
4556
|
+
:param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
|
|
3625
4557
|
:param vpc: (experimental) The ID of the VPC for which to create the VPN gateway.
|
|
3626
|
-
:param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: none
|
|
3627
|
-
:param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: none
|
|
3628
4558
|
|
|
3629
4559
|
:stability: experimental
|
|
3630
4560
|
:exampleMetadata: fixture=_generated
|
|
@@ -3636,23 +4566,34 @@ class VPNGatewayProps:
|
|
|
3636
4566
|
import aws_cdk.aws_ec2_alpha as ec2_alpha
|
|
3637
4567
|
from aws_cdk import aws_ec2 as ec2
|
|
3638
4568
|
|
|
4569
|
+
# subnet: ec2.Subnet
|
|
4570
|
+
# subnet_filter: ec2.SubnetFilter
|
|
3639
4571
|
# vpc_v2: ec2_alpha.VpcV2
|
|
3640
4572
|
|
|
3641
|
-
|
|
4573
|
+
v_pNGateway_v2_props = ec2_alpha.VPNGatewayV2Props(
|
|
3642
4574
|
type=ec2.VpnConnectionType.IPSEC_1,
|
|
3643
4575
|
vpc=vpc_v2,
|
|
3644
4576
|
|
|
3645
4577
|
# the properties below are optional
|
|
3646
4578
|
amazon_side_asn=123,
|
|
3647
|
-
vpn_gateway_name="vpnGatewayName"
|
|
4579
|
+
vpn_gateway_name="vpnGatewayName",
|
|
4580
|
+
vpn_route_propagation=[ec2.SubnetSelection(
|
|
4581
|
+
availability_zones=["availabilityZones"],
|
|
4582
|
+
one_per_az=False,
|
|
4583
|
+
subnet_filters=[subnet_filter],
|
|
4584
|
+
subnet_group_name="subnetGroupName",
|
|
4585
|
+
subnets=[subnet],
|
|
4586
|
+
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
|
|
4587
|
+
)]
|
|
3648
4588
|
)
|
|
3649
4589
|
'''
|
|
3650
4590
|
if __debug__:
|
|
3651
|
-
type_hints = typing.get_type_hints(
|
|
4591
|
+
type_hints = typing.get_type_hints(_typecheckingstub__3072d5168319d0db90903c5cbf3cd4040802f772c2763e1837c1fa6c7270ace9)
|
|
3652
4592
|
check_type(argname="argument type", value=type, expected_type=type_hints["type"])
|
|
3653
|
-
check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
|
|
3654
4593
|
check_type(argname="argument amazon_side_asn", value=amazon_side_asn, expected_type=type_hints["amazon_side_asn"])
|
|
3655
4594
|
check_type(argname="argument vpn_gateway_name", value=vpn_gateway_name, expected_type=type_hints["vpn_gateway_name"])
|
|
4595
|
+
check_type(argname="argument vpn_route_propagation", value=vpn_route_propagation, expected_type=type_hints["vpn_route_propagation"])
|
|
4596
|
+
check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
|
|
3656
4597
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
3657
4598
|
"type": type,
|
|
3658
4599
|
"vpc": vpc,
|
|
@@ -3661,6 +4602,8 @@ class VPNGatewayProps:
|
|
|
3661
4602
|
self._values["amazon_side_asn"] = amazon_side_asn
|
|
3662
4603
|
if vpn_gateway_name is not None:
|
|
3663
4604
|
self._values["vpn_gateway_name"] = vpn_gateway_name
|
|
4605
|
+
if vpn_route_propagation is not None:
|
|
4606
|
+
self._values["vpn_route_propagation"] = vpn_route_propagation
|
|
3664
4607
|
|
|
3665
4608
|
@builtins.property
|
|
3666
4609
|
def type(self) -> _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType:
|
|
@@ -3673,21 +4616,11 @@ class VPNGatewayProps:
|
|
|
3673
4616
|
assert result is not None, "Required property 'type' is missing"
|
|
3674
4617
|
return typing.cast(_aws_cdk_aws_ec2_ceddda9d.VpnConnectionType, result)
|
|
3675
4618
|
|
|
3676
|
-
@builtins.property
|
|
3677
|
-
def vpc(self) -> IVpcV2:
|
|
3678
|
-
'''(experimental) The ID of the VPC for which to create the VPN gateway.
|
|
3679
|
-
|
|
3680
|
-
:stability: experimental
|
|
3681
|
-
'''
|
|
3682
|
-
result = self._values.get("vpc")
|
|
3683
|
-
assert result is not None, "Required property 'vpc' is missing"
|
|
3684
|
-
return typing.cast(IVpcV2, result)
|
|
3685
|
-
|
|
3686
4619
|
@builtins.property
|
|
3687
4620
|
def amazon_side_asn(self) -> typing.Optional[jsii.Number]:
|
|
3688
4621
|
'''(experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
|
|
3689
4622
|
|
|
3690
|
-
:default:
|
|
4623
|
+
:default: - no ASN set for BGP session
|
|
3691
4624
|
|
|
3692
4625
|
:stability: experimental
|
|
3693
4626
|
'''
|
|
@@ -3698,13 +4631,36 @@ class VPNGatewayProps:
|
|
|
3698
4631
|
def vpn_gateway_name(self) -> typing.Optional[builtins.str]:
|
|
3699
4632
|
'''(experimental) The resource name of the VPN gateway.
|
|
3700
4633
|
|
|
3701
|
-
:default:
|
|
4634
|
+
:default: - resource provisioned without any name
|
|
3702
4635
|
|
|
3703
4636
|
:stability: experimental
|
|
3704
4637
|
'''
|
|
3705
4638
|
result = self._values.get("vpn_gateway_name")
|
|
3706
4639
|
return typing.cast(typing.Optional[builtins.str], result)
|
|
3707
4640
|
|
|
4641
|
+
@builtins.property
|
|
4642
|
+
def vpn_route_propagation(
|
|
4643
|
+
self,
|
|
4644
|
+
) -> typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]]:
|
|
4645
|
+
'''(experimental) Subnets where the route propagation should be added.
|
|
4646
|
+
|
|
4647
|
+
:default: - no propogation for routes
|
|
4648
|
+
|
|
4649
|
+
:stability: experimental
|
|
4650
|
+
'''
|
|
4651
|
+
result = self._values.get("vpn_route_propagation")
|
|
4652
|
+
return typing.cast(typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]], result)
|
|
4653
|
+
|
|
4654
|
+
@builtins.property
|
|
4655
|
+
def vpc(self) -> IVpcV2:
|
|
4656
|
+
'''(experimental) The ID of the VPC for which to create the VPN gateway.
|
|
4657
|
+
|
|
4658
|
+
:stability: experimental
|
|
4659
|
+
'''
|
|
4660
|
+
result = self._values.get("vpc")
|
|
4661
|
+
assert result is not None, "Required property 'vpc' is missing"
|
|
4662
|
+
return typing.cast(IVpcV2, result)
|
|
4663
|
+
|
|
3708
4664
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3709
4665
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3710
4666
|
|
|
@@ -3712,7 +4668,7 @@ class VPNGatewayProps:
|
|
|
3712
4668
|
return not (rhs == self)
|
|
3713
4669
|
|
|
3714
4670
|
def __repr__(self) -> str:
|
|
3715
|
-
return "
|
|
4671
|
+
return "VPNGatewayV2Props(%s)" % ", ".join(
|
|
3716
4672
|
k + "=" + repr(v) for k, v in self._values.items()
|
|
3717
4673
|
)
|
|
3718
4674
|
|
|
@@ -3727,7 +4683,6 @@ class VPNGatewayProps:
|
|
|
3727
4683
|
"ipv4_cidr_block": "ipv4CidrBlock",
|
|
3728
4684
|
"ipv4_ipam_pool": "ipv4IpamPool",
|
|
3729
4685
|
"ipv4_netmask_length": "ipv4NetmaskLength",
|
|
3730
|
-
"ipv6_cidr_block": "ipv6CidrBlock",
|
|
3731
4686
|
"ipv6_ipam_pool": "ipv6IpamPool",
|
|
3732
4687
|
"ipv6_netmask_length": "ipv6NetmaskLength",
|
|
3733
4688
|
},
|
|
@@ -3742,19 +4697,17 @@ class VpcCidrOptions:
|
|
|
3742
4697
|
ipv4_cidr_block: typing.Optional[builtins.str] = None,
|
|
3743
4698
|
ipv4_ipam_pool: typing.Optional[IIpamPool] = None,
|
|
3744
4699
|
ipv4_netmask_length: typing.Optional[jsii.Number] = None,
|
|
3745
|
-
ipv6_cidr_block: typing.Optional[builtins.str] = None,
|
|
3746
4700
|
ipv6_ipam_pool: typing.Optional[IIpamPool] = None,
|
|
3747
4701
|
ipv6_netmask_length: typing.Optional[jsii.Number] = None,
|
|
3748
4702
|
) -> None:
|
|
3749
4703
|
'''(experimental) Consolidated return parameters to pass to VPC construct.
|
|
3750
4704
|
|
|
3751
4705
|
:param amazon_provided: (experimental) Use amazon provided IP range. Default: false
|
|
3752
|
-
:param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource. Default:
|
|
4706
|
+
:param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource. Default: - no name for primary addresses
|
|
3753
4707
|
:param dependencies: (experimental) Dependency to associate Ipv6 CIDR block. Default: - No dependency
|
|
3754
|
-
:param ipv4_cidr_block: (experimental) IPv4 CIDR Block. Default:
|
|
4708
|
+
:param ipv4_cidr_block: (experimental) IPv4 CIDR Block. Default: '10.0.0.0/16'
|
|
3755
4709
|
:param ipv4_ipam_pool: (experimental) Ipv4 IPAM Pool. Default: - Only required when using IPAM Ipv4
|
|
3756
4710
|
:param ipv4_netmask_length: (experimental) CIDR Mask for Vpc. Default: - Only required when using IPAM Ipv4
|
|
3757
|
-
:param ipv6_cidr_block: (experimental) Implementing Ipv6. Default: - No ipv6 address
|
|
3758
4711
|
:param ipv6_ipam_pool: (experimental) Ipv6 IPAM pool id for VPC range, can only be defined under public scope. Default: - no pool id
|
|
3759
4712
|
:param ipv6_netmask_length: (experimental) CIDR Mask for Vpc. Default: - Only required when using AWS Ipam
|
|
3760
4713
|
|
|
@@ -3778,7 +4731,6 @@ class VpcCidrOptions:
|
|
|
3778
4731
|
ipv4_cidr_block="ipv4CidrBlock",
|
|
3779
4732
|
ipv4_ipam_pool=ipam_pool,
|
|
3780
4733
|
ipv4_netmask_length=123,
|
|
3781
|
-
ipv6_cidr_block="ipv6CidrBlock",
|
|
3782
4734
|
ipv6_ipam_pool=ipam_pool,
|
|
3783
4735
|
ipv6_netmask_length=123
|
|
3784
4736
|
)
|
|
@@ -3791,7 +4743,6 @@ class VpcCidrOptions:
|
|
|
3791
4743
|
check_type(argname="argument ipv4_cidr_block", value=ipv4_cidr_block, expected_type=type_hints["ipv4_cidr_block"])
|
|
3792
4744
|
check_type(argname="argument ipv4_ipam_pool", value=ipv4_ipam_pool, expected_type=type_hints["ipv4_ipam_pool"])
|
|
3793
4745
|
check_type(argname="argument ipv4_netmask_length", value=ipv4_netmask_length, expected_type=type_hints["ipv4_netmask_length"])
|
|
3794
|
-
check_type(argname="argument ipv6_cidr_block", value=ipv6_cidr_block, expected_type=type_hints["ipv6_cidr_block"])
|
|
3795
4746
|
check_type(argname="argument ipv6_ipam_pool", value=ipv6_ipam_pool, expected_type=type_hints["ipv6_ipam_pool"])
|
|
3796
4747
|
check_type(argname="argument ipv6_netmask_length", value=ipv6_netmask_length, expected_type=type_hints["ipv6_netmask_length"])
|
|
3797
4748
|
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
@@ -3807,8 +4758,6 @@ class VpcCidrOptions:
|
|
|
3807
4758
|
self._values["ipv4_ipam_pool"] = ipv4_ipam_pool
|
|
3808
4759
|
if ipv4_netmask_length is not None:
|
|
3809
4760
|
self._values["ipv4_netmask_length"] = ipv4_netmask_length
|
|
3810
|
-
if ipv6_cidr_block is not None:
|
|
3811
|
-
self._values["ipv6_cidr_block"] = ipv6_cidr_block
|
|
3812
4761
|
if ipv6_ipam_pool is not None:
|
|
3813
4762
|
self._values["ipv6_ipam_pool"] = ipv6_ipam_pool
|
|
3814
4763
|
if ipv6_netmask_length is not None:
|
|
@@ -3829,7 +4778,7 @@ class VpcCidrOptions:
|
|
|
3829
4778
|
def cidr_block_name(self) -> typing.Optional[builtins.str]:
|
|
3830
4779
|
'''(experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource.
|
|
3831
4780
|
|
|
3832
|
-
:default:
|
|
4781
|
+
:default: - no name for primary addresses
|
|
3833
4782
|
|
|
3834
4783
|
:stability: experimental
|
|
3835
4784
|
'''
|
|
@@ -3853,7 +4802,7 @@ class VpcCidrOptions:
|
|
|
3853
4802
|
def ipv4_cidr_block(self) -> typing.Optional[builtins.str]:
|
|
3854
4803
|
'''(experimental) IPv4 CIDR Block.
|
|
3855
4804
|
|
|
3856
|
-
:default:
|
|
4805
|
+
:default: '10.0.0.0/16'
|
|
3857
4806
|
|
|
3858
4807
|
:stability: experimental
|
|
3859
4808
|
'''
|
|
@@ -3882,17 +4831,6 @@ class VpcCidrOptions:
|
|
|
3882
4831
|
result = self._values.get("ipv4_netmask_length")
|
|
3883
4832
|
return typing.cast(typing.Optional[jsii.Number], result)
|
|
3884
4833
|
|
|
3885
|
-
@builtins.property
|
|
3886
|
-
def ipv6_cidr_block(self) -> typing.Optional[builtins.str]:
|
|
3887
|
-
'''(experimental) Implementing Ipv6.
|
|
3888
|
-
|
|
3889
|
-
:default: - No ipv6 address
|
|
3890
|
-
|
|
3891
|
-
:stability: experimental
|
|
3892
|
-
'''
|
|
3893
|
-
result = self._values.get("ipv6_cidr_block")
|
|
3894
|
-
return typing.cast(typing.Optional[builtins.str], result)
|
|
3895
|
-
|
|
3896
4834
|
@builtins.property
|
|
3897
4835
|
def ipv6_ipam_pool(self) -> typing.Optional[IIpamPool]:
|
|
3898
4836
|
'''(experimental) Ipv6 IPAM pool id for VPC range, can only be defined under public scope.
|
|
@@ -4048,6 +4986,28 @@ class VpcV2Base(
|
|
|
4048
4986
|
|
|
4049
4987
|
return typing.cast(_aws_cdk_aws_ec2_ceddda9d.ClientVpnEndpoint, jsii.invoke(self, "addClientVpnEndpoint", [id, options]))
|
|
4050
4988
|
|
|
4989
|
+
@jsii.member(jsii_name="addEgressOnlyInternetGateway")
|
|
4990
|
+
def add_egress_only_internet_gateway(
|
|
4991
|
+
self,
|
|
4992
|
+
*,
|
|
4993
|
+
destination: typing.Optional[builtins.str] = None,
|
|
4994
|
+
subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4995
|
+
) -> None:
|
|
4996
|
+
'''(experimental) Adds a new Egress Only Internet Gateway to this VPC and defines a new route to the route table of given subnets.
|
|
4997
|
+
|
|
4998
|
+
:param destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
|
|
4999
|
+
:param subnets: (experimental) List of subnets where route to EGW will be added. Default: - no route created
|
|
5000
|
+
|
|
5001
|
+
:default: - in case of no input subnets, no route is created
|
|
5002
|
+
|
|
5003
|
+
:stability: experimental
|
|
5004
|
+
'''
|
|
5005
|
+
options = EgressOnlyInternetGatewayOptions(
|
|
5006
|
+
destination=destination, subnets=subnets
|
|
5007
|
+
)
|
|
5008
|
+
|
|
5009
|
+
return typing.cast(None, jsii.invoke(self, "addEgressOnlyInternetGateway", [options]))
|
|
5010
|
+
|
|
4051
5011
|
@jsii.member(jsii_name="addFlowLog")
|
|
4052
5012
|
def add_flow_log(
|
|
4053
5013
|
self,
|
|
@@ -4143,6 +5103,70 @@ class VpcV2Base(
|
|
|
4143
5103
|
|
|
4144
5104
|
return typing.cast(_aws_cdk_aws_ec2_ceddda9d.InterfaceVpcEndpoint, jsii.invoke(self, "addInterfaceEndpoint", [id, options]))
|
|
4145
5105
|
|
|
5106
|
+
@jsii.member(jsii_name="addInternetGateway")
|
|
5107
|
+
def add_internet_gateway(
|
|
5108
|
+
self,
|
|
5109
|
+
*,
|
|
5110
|
+
ipv4_destination: typing.Optional[builtins.str] = None,
|
|
5111
|
+
ipv6_destination: typing.Optional[builtins.str] = None,
|
|
5112
|
+
) -> None:
|
|
5113
|
+
'''(experimental) Adds a new Internet Gateway to this VPC.
|
|
5114
|
+
|
|
5115
|
+
:param ipv4_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '0.0.0.0' all Ipv4 traffic
|
|
5116
|
+
:param ipv6_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
|
|
5117
|
+
|
|
5118
|
+
:default: - creates a new route for public subnets(with all outbound access) to the Internet Gateway.
|
|
5119
|
+
|
|
5120
|
+
:stability: experimental
|
|
5121
|
+
'''
|
|
5122
|
+
options = InternetGatewayOptions(
|
|
5123
|
+
ipv4_destination=ipv4_destination, ipv6_destination=ipv6_destination
|
|
5124
|
+
)
|
|
5125
|
+
|
|
5126
|
+
return typing.cast(None, jsii.invoke(self, "addInternetGateway", [options]))
|
|
5127
|
+
|
|
5128
|
+
@jsii.member(jsii_name="addNatGateway")
|
|
5129
|
+
def add_nat_gateway(
|
|
5130
|
+
self,
|
|
5131
|
+
*,
|
|
5132
|
+
subnet: ISubnetV2,
|
|
5133
|
+
allocation_id: typing.Optional[builtins.str] = None,
|
|
5134
|
+
connectivity_type: typing.Optional[NatConnectivityType] = None,
|
|
5135
|
+
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
5136
|
+
nat_gateway_name: typing.Optional[builtins.str] = None,
|
|
5137
|
+
private_ip_address: typing.Optional[builtins.str] = None,
|
|
5138
|
+
secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
5139
|
+
secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
|
|
5140
|
+
secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
5141
|
+
) -> NatGateway:
|
|
5142
|
+
'''(experimental) Adds a new NAT Gateway to the given subnet of this VPC of given subnets.
|
|
5143
|
+
|
|
5144
|
+
:param subnet: (experimental) The subnet in which the NAT gateway is located.
|
|
5145
|
+
:param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
|
|
5146
|
+
:param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
|
|
5147
|
+
:param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
|
|
5148
|
+
:param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
|
|
5149
|
+
:param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
|
|
5150
|
+
:param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
|
|
5151
|
+
:param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
|
|
5152
|
+
:param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
|
|
5153
|
+
|
|
5154
|
+
:stability: experimental
|
|
5155
|
+
'''
|
|
5156
|
+
options = NatGatewayOptions(
|
|
5157
|
+
subnet=subnet,
|
|
5158
|
+
allocation_id=allocation_id,
|
|
5159
|
+
connectivity_type=connectivity_type,
|
|
5160
|
+
max_drain_duration=max_drain_duration,
|
|
5161
|
+
nat_gateway_name=nat_gateway_name,
|
|
5162
|
+
private_ip_address=private_ip_address,
|
|
5163
|
+
secondary_allocation_ids=secondary_allocation_ids,
|
|
5164
|
+
secondary_private_ip_address_count=secondary_private_ip_address_count,
|
|
5165
|
+
secondary_private_ip_addresses=secondary_private_ip_addresses,
|
|
5166
|
+
)
|
|
5167
|
+
|
|
5168
|
+
return typing.cast(NatGateway, jsii.invoke(self, "addNatGateway", [options]))
|
|
5169
|
+
|
|
4146
5170
|
@jsii.member(jsii_name="addVpnConnection")
|
|
4147
5171
|
def add_vpn_connection(
|
|
4148
5172
|
self,
|
|
@@ -4180,13 +5204,15 @@ class VpcV2Base(
|
|
|
4180
5204
|
type: builtins.str,
|
|
4181
5205
|
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
4182
5206
|
) -> None:
|
|
4183
|
-
'''(
|
|
5207
|
+
'''(deprecated) Adds a VPN Gateway to this VPC.
|
|
4184
5208
|
|
|
4185
5209
|
:param vpn_route_propagation: Provide an array of subnets where the route propagation should be added. Default: noPropagation
|
|
4186
5210
|
:param type: Default type ipsec.1.
|
|
4187
5211
|
:param amazon_side_asn: Explicitly specify an Asn or let aws pick an Asn for you. Default: 65000
|
|
4188
5212
|
|
|
4189
|
-
:
|
|
5213
|
+
:deprecated: use enableVpnGatewayV2 for compatibility with VPCV2.Route
|
|
5214
|
+
|
|
5215
|
+
:stability: deprecated
|
|
4190
5216
|
'''
|
|
4191
5217
|
options = _aws_cdk_aws_ec2_ceddda9d.EnableVpnGatewayOptions(
|
|
4192
5218
|
vpn_route_propagation=vpn_route_propagation,
|
|
@@ -4196,6 +5222,33 @@ class VpcV2Base(
|
|
|
4196
5222
|
|
|
4197
5223
|
return typing.cast(None, jsii.invoke(self, "enableVpnGateway", [options]))
|
|
4198
5224
|
|
|
5225
|
+
@jsii.member(jsii_name="enableVpnGatewayV2")
|
|
5226
|
+
def enable_vpn_gateway_v2(
|
|
5227
|
+
self,
|
|
5228
|
+
*,
|
|
5229
|
+
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
5230
|
+
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
5231
|
+
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
5232
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
5233
|
+
) -> VPNGatewayV2:
|
|
5234
|
+
'''(experimental) Adds VPNGAtewayV2 to this VPC.
|
|
5235
|
+
|
|
5236
|
+
:param type: (experimental) The type of VPN connection the virtual private gateway supports.
|
|
5237
|
+
:param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
|
|
5238
|
+
:param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
|
|
5239
|
+
:param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
|
|
5240
|
+
|
|
5241
|
+
:stability: experimental
|
|
5242
|
+
'''
|
|
5243
|
+
options = VPNGatewayV2Options(
|
|
5244
|
+
type=type,
|
|
5245
|
+
amazon_side_asn=amazon_side_asn,
|
|
5246
|
+
vpn_gateway_name=vpn_gateway_name,
|
|
5247
|
+
vpn_route_propagation=vpn_route_propagation,
|
|
5248
|
+
)
|
|
5249
|
+
|
|
5250
|
+
return typing.cast(VPNGatewayV2, jsii.invoke(self, "enableVpnGatewayV2", [options]))
|
|
5251
|
+
|
|
4199
5252
|
@jsii.member(jsii_name="selectSubnetObjects")
|
|
4200
5253
|
def _select_subnet_objects(
|
|
4201
5254
|
self,
|
|
@@ -4368,6 +5421,15 @@ class VpcV2Base(
|
|
|
4368
5421
|
'''
|
|
4369
5422
|
...
|
|
4370
5423
|
|
|
5424
|
+
@builtins.property
|
|
5425
|
+
@jsii.member(jsii_name="internetGatewayId")
|
|
5426
|
+
def internet_gateway_id(self) -> typing.Optional[builtins.str]:
|
|
5427
|
+
'''(experimental) Returns the id of the Internet Gateway (if enabled).
|
|
5428
|
+
|
|
5429
|
+
:stability: experimental
|
|
5430
|
+
'''
|
|
5431
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "internetGatewayId"))
|
|
5432
|
+
|
|
4371
5433
|
@builtins.property
|
|
4372
5434
|
@jsii.member(jsii_name="vpnGatewayId")
|
|
4373
5435
|
def vpn_gateway_id(self) -> typing.Optional[builtins.str]:
|
|
@@ -4499,9 +5561,9 @@ class VpcV2Props:
|
|
|
4499
5561
|
:param default_instance_tenancy: (experimental) The default tenancy of instances launched into the VPC. By setting this to dedicated tenancy, instances will be launched on hardware dedicated to a single AWS customer, unless specifically specified at instance launch time. Please note, not all instance types are usable with Dedicated tenancy. Default: DefaultInstanceTenancy.Default (shared) tenancy
|
|
4500
5562
|
:param enable_dns_hostnames: (experimental) Indicates whether the instances launched in the VPC get DNS hostnames. Default: true
|
|
4501
5563
|
:param enable_dns_support: (experimental) Indicates whether the DNS resolution is supported for the VPC. Default: true
|
|
4502
|
-
:param primary_address_block: (experimental) A must IPv4 CIDR block for the VPC
|
|
4503
|
-
:param secondary_address_blocks: (experimental) The secondary CIDR blocks associated with the VPC. Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention For more information,
|
|
4504
|
-
:param vpc_name: (experimental) Physical name for the VPC. Default:
|
|
5564
|
+
:param primary_address_block: (experimental) A must IPv4 CIDR block for the VPC. Default: - Ipv4 CIDR Block ('10.0.0.0/16')
|
|
5565
|
+
:param secondary_address_blocks: (experimental) The secondary CIDR blocks associated with the VPC. Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention For more information, Default: - No secondary IP address
|
|
5566
|
+
:param vpc_name: (experimental) Physical name for the VPC. Default: - autogenerated by CDK
|
|
4505
5567
|
|
|
4506
5568
|
:stability: experimental
|
|
4507
5569
|
:exampleMetadata: infused
|
|
@@ -4509,19 +5571,22 @@ class VpcV2Props:
|
|
|
4509
5571
|
Example::
|
|
4510
5572
|
|
|
4511
5573
|
stack = Stack()
|
|
4512
|
-
my_vpc =
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
5574
|
+
my_vpc = VpcV2(self, "Vpc",
|
|
5575
|
+
primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
|
|
5576
|
+
secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
|
|
5577
|
+
cidr_block_name="AmazonProvided"
|
|
5578
|
+
)]
|
|
4516
5579
|
)
|
|
4517
5580
|
|
|
4518
|
-
|
|
4519
|
-
vpc=my_vpc
|
|
4520
|
-
availability_zone="us-east-1a",
|
|
4521
|
-
ipv4_cidr_block=vpc_v2.IpCidr("10.0.0.0/24"),
|
|
4522
|
-
ipv6_cidr_block=vpc_v2.IpCidr("2a05:d02c:25:4000::/60"),
|
|
4523
|
-
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
|
|
5581
|
+
eigw = EgressOnlyInternetGateway(self, "EIGW",
|
|
5582
|
+
vpc=my_vpc
|
|
4524
5583
|
)
|
|
5584
|
+
|
|
5585
|
+
route_table = RouteTable(self, "RouteTable",
|
|
5586
|
+
vpc=my_vpc
|
|
5587
|
+
)
|
|
5588
|
+
|
|
5589
|
+
route_table.add_route("EIGW", "::/0", {"gateway": eigw})
|
|
4525
5590
|
'''
|
|
4526
5591
|
if __debug__:
|
|
4527
5592
|
type_hints = typing.get_type_hints(_typecheckingstub__8f915ef5e4a9fa4854227228067c81d198633b3f6b9621c83cee1390bc703549)
|
|
@@ -4587,10 +5652,11 @@ class VpcV2Props:
|
|
|
4587
5652
|
|
|
4588
5653
|
@builtins.property
|
|
4589
5654
|
def primary_address_block(self) -> typing.Optional[IIpAddresses]:
|
|
4590
|
-
'''(experimental) A must IPv4 CIDR block for the VPC
|
|
5655
|
+
'''(experimental) A must IPv4 CIDR block for the VPC.
|
|
4591
5656
|
|
|
4592
5657
|
:default: - Ipv4 CIDR Block ('10.0.0.0/16')
|
|
4593
5658
|
|
|
5659
|
+
:see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html
|
|
4594
5660
|
:stability: experimental
|
|
4595
5661
|
'''
|
|
4596
5662
|
result = self._values.get("primary_address_block")
|
|
@@ -4601,10 +5667,11 @@ class VpcV2Props:
|
|
|
4601
5667
|
'''(experimental) The secondary CIDR blocks associated with the VPC.
|
|
4602
5668
|
|
|
4603
5669
|
Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention
|
|
4604
|
-
For more information,
|
|
5670
|
+
For more information,
|
|
4605
5671
|
|
|
4606
5672
|
:default: - No secondary IP address
|
|
4607
5673
|
|
|
5674
|
+
:see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
|
|
4608
5675
|
:stability: experimental
|
|
4609
5676
|
'''
|
|
4610
5677
|
result = self._values.get("secondary_address_blocks")
|
|
@@ -4614,7 +5681,7 @@ class VpcV2Props:
|
|
|
4614
5681
|
def vpc_name(self) -> typing.Optional[builtins.str]:
|
|
4615
5682
|
'''(experimental) Physical name for the VPC.
|
|
4616
5683
|
|
|
4617
|
-
:default:
|
|
5684
|
+
:default: - autogenerated by CDK
|
|
4618
5685
|
|
|
4619
5686
|
:stability: experimental
|
|
4620
5687
|
'''
|
|
@@ -4643,22 +5710,27 @@ class EgressOnlyInternetGateway(
|
|
|
4643
5710
|
|
|
4644
5711
|
:stability: experimental
|
|
4645
5712
|
:resource: AWS::EC2::EgressOnlyInternetGateway
|
|
4646
|
-
:exampleMetadata:
|
|
5713
|
+
:exampleMetadata: infused
|
|
4647
5714
|
|
|
4648
5715
|
Example::
|
|
4649
5716
|
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
5717
|
+
stack = Stack()
|
|
5718
|
+
my_vpc = VpcV2(self, "Vpc",
|
|
5719
|
+
primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
|
|
5720
|
+
secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
|
|
5721
|
+
cidr_block_name="AmazonProvided"
|
|
5722
|
+
)]
|
|
5723
|
+
)
|
|
4655
5724
|
|
|
4656
|
-
|
|
4657
|
-
vpc=
|
|
5725
|
+
eigw = EgressOnlyInternetGateway(self, "EIGW",
|
|
5726
|
+
vpc=my_vpc
|
|
5727
|
+
)
|
|
4658
5728
|
|
|
4659
|
-
|
|
4660
|
-
|
|
5729
|
+
route_table = RouteTable(self, "RouteTable",
|
|
5730
|
+
vpc=my_vpc
|
|
4661
5731
|
)
|
|
5732
|
+
|
|
5733
|
+
route_table.add_route("EIGW", "::/0", {"gateway": eigw})
|
|
4662
5734
|
'''
|
|
4663
5735
|
|
|
4664
5736
|
def __init__(
|
|
@@ -4673,7 +5745,7 @@ class EgressOnlyInternetGateway(
|
|
|
4673
5745
|
:param scope: -
|
|
4674
5746
|
:param id: -
|
|
4675
5747
|
:param vpc: (experimental) The ID of the VPC for which to create the egress-only internet gateway.
|
|
4676
|
-
:param egress_only_internet_gateway_name: (experimental) The resource name of the egress-only internet gateway. Default:
|
|
5748
|
+
:param egress_only_internet_gateway_name: (experimental) The resource name of the egress-only internet gateway. Default: - provisioned without a resource name
|
|
4677
5749
|
|
|
4678
5750
|
:stability: experimental
|
|
4679
5751
|
'''
|
|
@@ -4731,26 +5803,22 @@ class VpcV2(
|
|
|
4731
5803
|
|
|
4732
5804
|
Example::
|
|
4733
5805
|
|
|
4734
|
-
|
|
4735
|
-
|
|
5806
|
+
stack = Stack()
|
|
5807
|
+
my_vpc = VpcV2(self, "Vpc")
|
|
5808
|
+
route_table = RouteTable(self, "RouteTable",
|
|
4736
5809
|
vpc=my_vpc
|
|
4737
5810
|
)
|
|
4738
|
-
subnet =
|
|
5811
|
+
subnet = SubnetV2(self, "Subnet",
|
|
4739
5812
|
vpc=my_vpc,
|
|
4740
5813
|
availability_zone="eu-west-2a",
|
|
4741
5814
|
ipv4_cidr_block=IpCidr("10.0.0.0/24"),
|
|
4742
|
-
subnet_type=
|
|
5815
|
+
subnet_type=SubnetType.PUBLIC
|
|
4743
5816
|
)
|
|
4744
5817
|
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
)
|
|
4750
|
-
vpc_v2.Route(self, "DynamoDBRoute",
|
|
4751
|
-
route_table=route_table,
|
|
4752
|
-
destination="0.0.0.0/0",
|
|
4753
|
-
target={"endpoint": dynamo_endpoint}
|
|
5818
|
+
my_vpc.add_internet_gateway()
|
|
5819
|
+
my_vpc.add_nat_gateway(
|
|
5820
|
+
subnet=subnet,
|
|
5821
|
+
connectivity_type=NatConnectivityType.PUBLIC
|
|
4754
5822
|
)
|
|
4755
5823
|
'''
|
|
4756
5824
|
|
|
@@ -4772,9 +5840,9 @@ class VpcV2(
|
|
|
4772
5840
|
:param default_instance_tenancy: (experimental) The default tenancy of instances launched into the VPC. By setting this to dedicated tenancy, instances will be launched on hardware dedicated to a single AWS customer, unless specifically specified at instance launch time. Please note, not all instance types are usable with Dedicated tenancy. Default: DefaultInstanceTenancy.Default (shared) tenancy
|
|
4773
5841
|
:param enable_dns_hostnames: (experimental) Indicates whether the instances launched in the VPC get DNS hostnames. Default: true
|
|
4774
5842
|
:param enable_dns_support: (experimental) Indicates whether the DNS resolution is supported for the VPC. Default: true
|
|
4775
|
-
:param primary_address_block: (experimental) A must IPv4 CIDR block for the VPC
|
|
4776
|
-
:param secondary_address_blocks: (experimental) The secondary CIDR blocks associated with the VPC. Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention For more information,
|
|
4777
|
-
:param vpc_name: (experimental) Physical name for the VPC. Default:
|
|
5843
|
+
:param primary_address_block: (experimental) A must IPv4 CIDR block for the VPC. Default: - Ipv4 CIDR Block ('10.0.0.0/16')
|
|
5844
|
+
:param secondary_address_blocks: (experimental) The secondary CIDR blocks associated with the VPC. Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention For more information, Default: - No secondary IP address
|
|
5845
|
+
:param vpc_name: (experimental) Physical name for the VPC. Default: - autogenerated by CDK
|
|
4778
5846
|
|
|
4779
5847
|
:stability: experimental
|
|
4780
5848
|
'''
|
|
@@ -4903,7 +5971,7 @@ class VpcV2(
|
|
|
4903
5971
|
@builtins.property
|
|
4904
5972
|
@jsii.member(jsii_name="useIpv6")
|
|
4905
5973
|
def use_ipv6(self) -> builtins.bool:
|
|
4906
|
-
'''(experimental) For validation to define IPv6 subnets, set to true in case of Amazon Provided IPv6 cidr range IPv6 addresses can be attached to the subnets.
|
|
5974
|
+
'''(experimental) For validation to define IPv6 subnets, set to true in case of Amazon Provided IPv6 cidr range if true, IPv6 addresses can be attached to the subnets.
|
|
4907
5975
|
|
|
4908
5976
|
:default: false
|
|
4909
5977
|
|
|
@@ -4945,6 +6013,7 @@ __all__ = [
|
|
|
4945
6013
|
"AddressFamily",
|
|
4946
6014
|
"AwsServiceName",
|
|
4947
6015
|
"EgressOnlyInternetGateway",
|
|
6016
|
+
"EgressOnlyInternetGatewayOptions",
|
|
4948
6017
|
"EgressOnlyInternetGatewayProps",
|
|
4949
6018
|
"IIpAddresses",
|
|
4950
6019
|
"IIpamPool",
|
|
@@ -4954,6 +6023,7 @@ __all__ = [
|
|
|
4954
6023
|
"ISubnetV2",
|
|
4955
6024
|
"IVpcV2",
|
|
4956
6025
|
"InternetGateway",
|
|
6026
|
+
"InternetGatewayOptions",
|
|
4957
6027
|
"InternetGatewayProps",
|
|
4958
6028
|
"IpAddresses",
|
|
4959
6029
|
"IpCidr",
|
|
@@ -4966,6 +6036,7 @@ __all__ = [
|
|
|
4966
6036
|
"IpamScopeType",
|
|
4967
6037
|
"NatConnectivityType",
|
|
4968
6038
|
"NatGateway",
|
|
6039
|
+
"NatGatewayOptions",
|
|
4969
6040
|
"NatGatewayProps",
|
|
4970
6041
|
"PoolOptions",
|
|
4971
6042
|
"Route",
|
|
@@ -4977,8 +6048,9 @@ __all__ = [
|
|
|
4977
6048
|
"SecondaryAddressProps",
|
|
4978
6049
|
"SubnetV2",
|
|
4979
6050
|
"SubnetV2Props",
|
|
4980
|
-
"
|
|
4981
|
-
"
|
|
6051
|
+
"VPNGatewayV2",
|
|
6052
|
+
"VPNGatewayV2Options",
|
|
6053
|
+
"VPNGatewayV2Props",
|
|
4982
6054
|
"VpcCidrOptions",
|
|
4983
6055
|
"VpcV2",
|
|
4984
6056
|
"VpcV2Base",
|
|
@@ -4987,6 +6059,14 @@ __all__ = [
|
|
|
4987
6059
|
|
|
4988
6060
|
publication.publish()
|
|
4989
6061
|
|
|
6062
|
+
def _typecheckingstub__47cf639398ded64820e35dac43908a70a34ddc76a3ed35cc0c24357b0e01f48d(
|
|
6063
|
+
*,
|
|
6064
|
+
destination: typing.Optional[builtins.str] = None,
|
|
6065
|
+
subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
6066
|
+
) -> None:
|
|
6067
|
+
"""Type checking stubs"""
|
|
6068
|
+
pass
|
|
6069
|
+
|
|
4990
6070
|
def _typecheckingstub__a1cb0281052a85d3461453c956e87b81e82be05002c1ac33451b382cfcf0ea7e(
|
|
4991
6071
|
*,
|
|
4992
6072
|
vpc: IVpcV2,
|
|
@@ -5026,6 +6106,14 @@ def _typecheckingstub__a1ed9b26ff938b529db1af6f12978e1aa57b9cdaf5a5c589675cf7b8f
|
|
|
5026
6106
|
"""Type checking stubs"""
|
|
5027
6107
|
pass
|
|
5028
6108
|
|
|
6109
|
+
def _typecheckingstub__1767be14586e30c26bcd910b9753aae1720568db2bf09fbf8dd100e10ab1fc09(
|
|
6110
|
+
*,
|
|
6111
|
+
ipv4_destination: typing.Optional[builtins.str] = None,
|
|
6112
|
+
ipv6_destination: typing.Optional[builtins.str] = None,
|
|
6113
|
+
) -> None:
|
|
6114
|
+
"""Type checking stubs"""
|
|
6115
|
+
pass
|
|
6116
|
+
|
|
5029
6117
|
def _typecheckingstub__b4699002455f77fce358247d059e2af25aa232257e94012a7ff9adcc0f4d4268(
|
|
5030
6118
|
*,
|
|
5031
6119
|
vpc: IVpcV2,
|
|
@@ -5103,7 +6191,23 @@ def _typecheckingstub__3204c5cc1ee92d73075b1e2c597a7d7bb9eb73b154f33262369b6b4ac
|
|
|
5103
6191
|
scope: _constructs_77d1e7e8.Construct,
|
|
5104
6192
|
id: builtins.str,
|
|
5105
6193
|
*,
|
|
5106
|
-
|
|
6194
|
+
vpc: typing.Optional[IVpcV2] = None,
|
|
6195
|
+
subnet: ISubnetV2,
|
|
6196
|
+
allocation_id: typing.Optional[builtins.str] = None,
|
|
6197
|
+
connectivity_type: typing.Optional[NatConnectivityType] = None,
|
|
6198
|
+
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
6199
|
+
nat_gateway_name: typing.Optional[builtins.str] = None,
|
|
6200
|
+
private_ip_address: typing.Optional[builtins.str] = None,
|
|
6201
|
+
secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
6202
|
+
secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
|
|
6203
|
+
secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
6204
|
+
) -> None:
|
|
6205
|
+
"""Type checking stubs"""
|
|
6206
|
+
pass
|
|
6207
|
+
|
|
6208
|
+
def _typecheckingstub__b95898dda7ef46705953a45c7eea2438b79c93d898a7eb07a91955ee9ff221c7(
|
|
6209
|
+
*,
|
|
6210
|
+
subnet: ISubnetV2,
|
|
5107
6211
|
allocation_id: typing.Optional[builtins.str] = None,
|
|
5108
6212
|
connectivity_type: typing.Optional[NatConnectivityType] = None,
|
|
5109
6213
|
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
@@ -5112,14 +6216,13 @@ def _typecheckingstub__3204c5cc1ee92d73075b1e2c597a7d7bb9eb73b154f33262369b6b4ac
|
|
|
5112
6216
|
secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
5113
6217
|
secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
|
|
5114
6218
|
secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
5115
|
-
vpc: typing.Optional[IVpcV2] = None,
|
|
5116
6219
|
) -> None:
|
|
5117
6220
|
"""Type checking stubs"""
|
|
5118
6221
|
pass
|
|
5119
6222
|
|
|
5120
6223
|
def _typecheckingstub__50c6c285bd9604aa1bbf23945426abd3cb4259870f0a85edd40b87eb08b29903(
|
|
5121
6224
|
*,
|
|
5122
|
-
subnet:
|
|
6225
|
+
subnet: ISubnetV2,
|
|
5123
6226
|
allocation_id: typing.Optional[builtins.str] = None,
|
|
5124
6227
|
connectivity_type: typing.Optional[NatConnectivityType] = None,
|
|
5125
6228
|
max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
|
|
@@ -5176,6 +6279,14 @@ def _typecheckingstub__cfa486baea72e1e0413e458ea1f52d60725dbcdfeed33f2e810006af4
|
|
|
5176
6279
|
"""Type checking stubs"""
|
|
5177
6280
|
pass
|
|
5178
6281
|
|
|
6282
|
+
def _typecheckingstub__920d6a12797cd2ad571157da68e37100c7d72b72ff09fd42451a65b73f154dd0(
|
|
6283
|
+
id: builtins.str,
|
|
6284
|
+
destination: builtins.str,
|
|
6285
|
+
target: RouteTargetType,
|
|
6286
|
+
) -> None:
|
|
6287
|
+
"""Type checking stubs"""
|
|
6288
|
+
pass
|
|
6289
|
+
|
|
5179
6290
|
def _typecheckingstub__271dc5ccfa2e958efecaeb52a22e0ecbf03734c62d76ebbf18cb73e88deea29f(
|
|
5180
6291
|
*,
|
|
5181
6292
|
vpc: IVpcV2,
|
|
@@ -5236,24 +6347,36 @@ def _typecheckingstub__95ce99f8025433ac8b79825abef6ff91da4dfd0693fd24dadedcee63e
|
|
|
5236
6347
|
"""Type checking stubs"""
|
|
5237
6348
|
pass
|
|
5238
6349
|
|
|
5239
|
-
def
|
|
6350
|
+
def _typecheckingstub__99ebb03388deee94929850a6302ea70455c70b08fdbc048c0ad431df4f5d7bff(
|
|
5240
6351
|
scope: _constructs_77d1e7e8.Construct,
|
|
5241
6352
|
id: builtins.str,
|
|
5242
6353
|
*,
|
|
5243
|
-
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
5244
6354
|
vpc: IVpcV2,
|
|
6355
|
+
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
5245
6356
|
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
5246
6357
|
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
6358
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
5247
6359
|
) -> None:
|
|
5248
6360
|
"""Type checking stubs"""
|
|
5249
6361
|
pass
|
|
5250
6362
|
|
|
5251
|
-
def
|
|
6363
|
+
def _typecheckingstub__e29191c56c11acb8fa2ca10b1e81f7c86e1e7ca21a360a0f41a7a6ec64c967c8(
|
|
6364
|
+
*,
|
|
6365
|
+
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
6366
|
+
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
6367
|
+
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
6368
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
6369
|
+
) -> None:
|
|
6370
|
+
"""Type checking stubs"""
|
|
6371
|
+
pass
|
|
6372
|
+
|
|
6373
|
+
def _typecheckingstub__3072d5168319d0db90903c5cbf3cd4040802f772c2763e1837c1fa6c7270ace9(
|
|
5252
6374
|
*,
|
|
5253
6375
|
type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
|
|
5254
|
-
vpc: IVpcV2,
|
|
5255
6376
|
amazon_side_asn: typing.Optional[jsii.Number] = None,
|
|
5256
6377
|
vpn_gateway_name: typing.Optional[builtins.str] = None,
|
|
6378
|
+
vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
6379
|
+
vpc: IVpcV2,
|
|
5257
6380
|
) -> None:
|
|
5258
6381
|
"""Type checking stubs"""
|
|
5259
6382
|
pass
|
|
@@ -5266,7 +6389,6 @@ def _typecheckingstub__dc5a774224468f268ba34d837f3aec361583306c8694ae77cdb19bb4c
|
|
|
5266
6389
|
ipv4_cidr_block: typing.Optional[builtins.str] = None,
|
|
5267
6390
|
ipv4_ipam_pool: typing.Optional[IIpamPool] = None,
|
|
5268
6391
|
ipv4_netmask_length: typing.Optional[jsii.Number] = None,
|
|
5269
|
-
ipv6_cidr_block: typing.Optional[builtins.str] = None,
|
|
5270
6392
|
ipv6_ipam_pool: typing.Optional[IIpamPool] = None,
|
|
5271
6393
|
ipv6_netmask_length: typing.Optional[jsii.Number] = None,
|
|
5272
6394
|
) -> None:
|