Hi all, A pulumi / aws incongruency I'm seeing, I...
# aws
b
Hi all, A pulumi / aws incongruency I'm seeing, I'm running this pulumi code, The screenshot clearly shows 6 subnets being created, 3 public 3 private, and confirmed in AWS, however pulumi only seems to report 2 are being created in the log messages. This is causing me issues trying to do loops for mounting filesystems etc. Anyone know if this is a pulumi bug or am I missing something more fundamental?
Copy code
import * as awsx from "@pulumi/awsx";
import * as pulumi from '@pulumi/pulumi';

const SERVICE = `BUG_MOUNT_COUNT`

// Create a new VPC with 3 public and private subnets
const vpc = new awsx.ec2.Vpc(`${SERVICE}-VPC`);

// logs a count of 2 errrenously
<http://pulumi.log.info|pulumi.log.info>(`publicSubNetID Count = ${vpc.publicSubnetIds.apply.length.toString()}`);
<http://pulumi.log.info|pulumi.log.info>(`privateSubNetID Count = ${vpc.privateSubnetIds.apply.length.toString()}`);
c
could it be that crosswalk does "By default, however, the
awsx.ec2.Vpc
resource will only use 2 of them when allocating subnets and the associated gateways" ?
b
Well they all have subnets and gateways associated
where are you quoting the line from?
c
In the screenshot we do see three VPCs. If you output the publicSubnetIds what do you see?
b
Ah I see the bug now
Copy code
vpc.publicSubnetIds.apply.length
This non function call version of .apply.length is returning the number of parameters to apply, which = 2!
f
Ha. The downside of using a programming language for your IaC, I guess.