Random aside <@UKQCFENQN>: do you know of any infr...
# general
s
Random aside @glamorous-waitress-51149: do you know of any infrastructure user groups in the south west?
g
something at the back of my head says there is one but can’t remember off the top of my head 🙂
b
g
b
There are also DotNet User Groups that would happily listen to how to build in Azure with TypeScript
g
back to the original question. trying
awsx.ec2.Vpc.fromExistingIds
seems to fail or doesn’t return an object for some reason. we’d like to have a vpc object that means we can access the
privateSubnetIds
property. any ideas?
s
How are you calling it?
When you pass in the existing IDs you have to nominate which subnets are respectively public, private and isolated
g
calling it like so:
Copy code
const primaryVpc = awsx.ec2.Vpc.fromExistingIds("primary", {
    vpcId: primaryVpcId
});
primaryVpcId
is a value in our config of the vpc id 🙂
b
Ok I have another suggestion about getting vpc @glamorous-waitress-51149
Trying it out now
g
ta, i mean i could rewrite what i have because the aws/awsx types don’t tie in eg/awsx wants a vpc type but aws returns a vpcresult type etc but I’d rather not 🙂
b
so you want the VPC so you can get the Subnets out of the object right?
g
yeah so i can create a dbsubnet but i also use what i retrieve here too
const sg = new awsx.ec2.SecurityGroup("jcsg", {vpc: primaryVpc});
b
👍
ok, @glamorous-waitress-51149 so I have the VPC object using this way instead now
trying one other way to see for compatability
g
thanks 👍
b
so both of these give me the same object
Copy code
const vpc = pulumi.output(aws.ec2.getVpc({
    id: "vpc-866580ff",
}));

export const id = vpc.id;

const primaryVpc = awsx.ec2.Vpc.fromExistingIds("primary", {
    vpcId: "vpc-866580ff"
});

export const xId = primaryVpc.id;
the result from the CLI is as follows:
Copy code
▶ pulumi up --yes
Previewing update (dev):

     Type                 Name         Plan
     pulumi:pulumi:Stack  aws-vpc-dev

Resources:
    2 unchanged

Updating (dev):

     Type                 Name         Status
     pulumi:pulumi:Stack  aws-vpc-dev

Outputs:
    id : "vpc-866580ff"
    xId: "vpc-866580ff"

Resources:
    2 unchanged

Duration: 8s
so if that
fromExistingIds
isn't returning an object, then there's something wrong with the lookup to your account
g
seems to export ok
b
but you can't use it?
g
privateSubnetIds is empty
b
ok so this is a bug - if you can see that there are private subnets in your account
then we have a bug in the awsx package
g
there in console
b
100% a bug then
I know you might not have time now, but can you file an issue when you get a chance?
there's a big release of the awxs module pending thathas a tonne of fixes...
I wonder if they will solve your problem...
g
if its a bug its in
fromExistingIds
because when you create a vpc its fine using
Copy code
const vpc = new awsx.ec2.Vpc("custom", {
    subnets: [{ type: "public" }, { type: "private" }],
});
b
i am wondering if its the parenting issue wrt to the VPC
g
fyi added a check for public ids too and thats empty too
b
there we are 🙂
Copy code
+ privateSubnets: []
  + publicSubnets : []
    xId           : "vpc-866580ff"
mine are empty too
this feels like a parenting bug
g
ok, glad i’m not being an annoying noob then
b
you 100% are not
legit bug
now whether it's solved by master is the question...
g
🤞
@broad-dog-22463 is there any ETA on the new release?
b
when the team come online today, I will ask when it's going to hit
I think this feels like a big bug we need to fix for people
can you add a github issue in pulumi/pulumi-awsx so I can point people at this?
g
👍
b
cheers man - I will see that we look into this
sorry for the hassle!
f
Cheers for the help here Paul 😉
b
👍
g
i thought i could work around the issue by calling
aws.ec2.getSubnetIds({vpcId: primaryVpcId,})
but problem is the results don’t tell you what type the subnet is eg/private/public/isolated etc 🙂
f
@glamorous-waitress-51149 Could we hard code any values in this stack for now?
g
that’s exactly what i’ve just done
🤢
f
ha
g
ooh i see a new pulumi version is available @broad-dog-22463 is that a coincidence? 🙂
b
Of Pulumi-awsx?
g
no the pulumi binary
b
I think that’s for something else :)
g
thought there might have been a massive roll out of everything 😉
b
nah, not the day before July 4th weekend!
g
b
😄