Skip to content

Commit baf4711

Browse files
dustinsestohlmann
authored andcommitted
fixed importing subnets incorrectly (#268)
1 parent 4d763c5 commit baf4711

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/networking/vpc/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ export class Vpc extends Construct {
7373
// A VPC must be supplied if Subnets are being used.
7474
if (config.subnets && config.subnets.length > 0) {
7575
this.subnetSelection = {
76-
subnets: props.config.subnets?.map((subnet, index) => Subnet.fromSubnetId(this, index.toString(), subnet.subnetId))
76+
subnets: props.config.subnets?.map((subnet, index) => Subnet.fromSubnetAttributes(this, index.toString(), {
77+
subnetId: subnet.subnetId,
78+
ipv4CidrBlock: subnet.ipv4CidrBlock
79+
}))
7780
};
7881

7982
this.subnetGroup = new SubnetGroup(this, createCdkId([config.deploymentName, 'Imported-Subnets']), {

0 commit comments

Comments
 (0)