https://pulumi.com logo
Title
l

loud-australia-45001

11/30/2022, 2:03 PM
Hello again, another doubt: We are facing a strange issue with creating the subnets in the VPC with
AWS CrossWalk
the following worked on
0.40.0
, the latter didn't with
1.0.0
. Can't understand why, it seems something related to the IPs This worked
const vpc = new awsx.ec2.Vpc(VPC_NAME, {
  cidrBlock: CIDR_BLOCK //is 10.0.0.0/16,
  numberOfAvailabilityZones: AVAILABILITY_ZONE //is 3,
  numberOfNatGateways: NUMBER_OF_GATEWAYS //is 1,
  subnets: [
    {
      cidrMask: 18,
      name: 'Private',
      type: 'private',
    },
    {
      cidrMask: 20,
      name: 'DBs',
      type: 'isolated',
    },
    {
      cidrMask: 22,
      name: 'Public',
      type: 'public',
    },
  ],
  tags: vpcTags,
});
This doesn't
const vpc = new awsx.ec2.Vpc(VPC_NAME, {
    cidrBlock: CIDR_BLOCK //is 10.0.0.0/16,
    numberOfAvailabilityZones: AVAILABILITY_ZONE //is 3,
    natGateways: {
      strategy: awsx.ec2.NatGatewayStrategy.Single,
    },
    subnetSpecs: [
      {
        cidrMask: 18,
        name: 'Private',
        type: awsx.ec2.SubnetType.Private,
      },
      {
        cidrMask: 20,
        name: 'Isolated',
        type: awsx.ec2.SubnetType.Isolated,
      },
      {
        cidrMask: 22,
        name: 'Public',
        type: awsx.ec2.SubnetType.Public,
      },
    ],
    tags: vpcTags,
  });
as far as I can see, this is how the actual code calculates the subnets
It seems that in the for cycle for the isolated, the last IP is not taken in account for the next AZs base ip
Further updates: • we found that the issue with the
v1.0.0
happens because we defined the Private subnet with
cidrMask: 18
• this happens because, with 3 AZs, the base IP are divided using the
/18
mask in 4 (leaving a single
/18
free) and the subnetSpecs ip calculations applied starting from the baseIp, so
/18
+
/20
+
/22
are overlapping, which wasn't happening before the upgrade.