New to CDK Typescript and thought this would be easy BUT I’m struggling to get this to work. I want to assign 3 subnets – 2 Public, 1 Private to a VPC at startup:
Public01: 10.10.5.0/24
Public02: 10.10.10.0/24
Private01: 10.10.15.0/24
Anyone know how this can be done? Currently I get 10.10.0.0/24, 10.10.1.0/24 and 10.10.2.0/24 – which i do not want:
const myvpc = new ec2.Vpc(this, 'MyVPC', {
maxAzs: 1,
natGateways: 0,
cidr: '10.10.0.0/16',
subnetConfiguration: [
{
cidrMask: 24,
name: 'Outside',
subnetType: ec2.SubnetType.PUBLIC,
},
{
cidrMask: 24,
name: 'Management',
subnetType: ec2.SubnetType.PUBLIC,
},
{
cidrMask: 24,
name: 'Inside',
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
},
],
});