Skip to content

Commit c1073bf

Browse files
authored
feat: configurable nat gateway Subnets (#11)
1 parent 47f84a9 commit c1073bf

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

API.md

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/constructs/network.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface ISubnetsProps {
5656
readonly egressNetworkACL?: NetworkACL[];
5757
readonly routes?: AddRouteOptions[];
5858
readonly tags?: Record<string, string>;
59+
readonly useSubnetForNAT?: boolean;
5960
}
6061
export interface VPCProps {
6162
readonly vpc: ec2.VpcProps;
@@ -115,6 +116,11 @@ export class Network extends Construct {
115116
sb instanceof ec2.PublicSubnet
116117
) {
117118
this.natSubnets.push(sb);
119+
} else if (
120+
sb instanceof ec2.PublicSubnet &&
121+
subnetProps.useSubnetForNAT == true
122+
) {
123+
this.natSubnets.push(sb);
118124
}
119125
});
120126
});

0 commit comments

Comments
 (0)