You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/@aws-cdk/aws-ec2/README.md
+25
Original file line number
Diff line number
Diff line change
@@ -273,6 +273,31 @@ new ec2.Vpc(stack, 'TheVPC', {
273
273
274
274
With this method of IP address management, no attempt is made to guess at subnet group sizes or to exhaustively allocate the IP range. All subnet groups must have an explicit `cidrMask` set as part of their subnet configuration, or `defaultSubnetIpv4NetmaskLength` must be set for a default size. If not, synthesis will fail and you must provide one or the other.
275
275
276
+
### Reserving availability zones
277
+
278
+
There are situations where the IP space for availability zones will
279
+
need to be reserved. This is useful in situations where availability
280
+
zones would need to be added after the vpc is originally deployed,
281
+
without causing IP renumbering for availability zones subnets. The IP
282
+
space for reserving `n` availability zones can be done by setting the
283
+
`reservedAzs` to `n` in vpc props, as shown below:
284
+
285
+
```ts
286
+
const vpc =newec2.Vpc(this, 'TheVPC', {
287
+
cidr: '10.0.0.0/21',
288
+
maxAzs: 3,
289
+
reservedAzs: 1,
290
+
});
291
+
```
292
+
293
+
In the example above, the subnets for reserved availability zones is not
294
+
actually provisioned but its IP space is still reserved. If, in the future,
295
+
new availability zones needs to be provisioned, then we would decrement
296
+
the value of `reservedAzs` and increment the `maxAzs` or `availabilityZones`
297
+
accordingly. This action would not cause the IP address of subnets to get
298
+
renumbered, but rather the IP space that was previously reserved will be
299
+
used for the new availability zones subnets.
300
+
276
301
### Advanced Subnet Configuration
277
302
278
303
If the default VPC configuration (public and private subnets spanning the
0 commit comments