I'm trying to utilize a vpc stack reference ``` ...
# general
m
I'm trying to utilize a vpc stack reference
Copy code
const vpc = awsx.ec2.Vpc.fromExistingIds(`vpc-${environment}-${regionAlias}`, {
        vpcId,
        privateSubnetIds,
        publicSubnetIds,
    });
For some reason the subnets that it returns have the wrong subnet name I'm seeing • vpc-dev-use1-private-0 • vpc-dev-use1-private-2 • vpc-dev-use1-private-1 • vpc-dev-use1-private-3 • vpc-dev-use1-public-1 • vpc-dev-use1-public-0 instead of • vpc-dev-use1-data-private-0 • vpc-dev-use1-data-private-1 • vpc-dev-use1-app-private-0 • vpc-dev-use1-app-private-1 • vpc-dev-use1-edge-private-0 • vpc-dev-use1-edge-private-1 The VPC is created in another stack like so:
Copy code
return new awsx.ec2.Vpc(vpcName, {
    ... redacted for brevity ...

    // Allocate three subnets per AZ: public (edge), private (app), private (data):
    subnets: [
        { type: 'public', name: 'edge', cidrMask: 24 }, // 256 IPs with CIDR mask of /24
        { type: 'private', name: 'app', cidrMask: 24 }, // 256 IPs with CIDR mask of /24
        { type: 'private', name: 'data', cidrMask: 24 }, // 256 IPs with CIDR mask of /24
    ]
});
What am I doing wrong?
e
It looks like its because awsx uses different names if your creating vs getting from existing. I don' t think this is anything your doing, you could raise an issue at https://github.com/pulumi/pulumi-awsx/. I'm not sure if awsx classic is getting updated anymore, but they could at least confirm this and possibly give an upgrade path to the new awsx types.