Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion src/constructs/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ export interface ISubnetsProps {
readonly routeTableStringFormat?: boolean;
readonly tags?: Record<string, string>;
readonly useSubnetForNAT?: boolean;
/**
* Do not add the automatic default route (0.0.0.0/0) to the same-AZ NAT gateway
* for the private subnets of this group. Declare your own 0.0.0.0/0 route in
* `routes` (e.g. RouterType.NAT_GATEWAY with a routerId) to pin egress to a
* specific NAT gateway.
*
* @default false
*/
readonly skipDefaultNatRoute?: boolean;
readonly useNestedStacks?: boolean;
}
export interface VPCProps {
Expand Down Expand Up @@ -157,7 +166,7 @@ export class Network extends Construct {
subnet.forEach((sb) => {
if (sb instanceof ec2.PublicSubnet) {
this.pbSubnets.push(sb);
} else if (sb instanceof ec2.PrivateSubnet) {
} else if (sb instanceof ec2.PrivateSubnet && !subnetProps.skipDefaultNatRoute) {
this.pvSubnets.push(sb);
}
if (
Expand Down
Loading