const vpc = new ec2.Vpc(this, 'testvpc', { natGateways: 1, cidr: '10.0.0.0/16' });
const change = ['10.0.7.0/24', '10.0.8.0/24', '10.0.9.0/24'];
for (let index = 0; index < change.length; index++) {
((vpc.node.findChild(`PublicSubnet${index + 1}`) as ec2.IPublicSubnet)
.node.findChild('Subnet') as ec2.CfnSubnet)
.addPropertyOverride('CidrBlock', change[index]);
}
Created
March 11, 2021 06:20
-
-
Save neilkuan/a5fca16fd3b46623a6a324815a8ea9d5 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment