https://pulumi.com logo
#general
Title
# general
s

stocky-spoon-28903

06/27/2019, 12:38 PM
Random aside @glamorous-waitress-51149: do you know of any infrastructure user groups in the south west?
g

glamorous-waitress-51149

06/27/2019, 12:41 PM
something at the back of my head says there is one but can’t remember off the top of my head 🙂
b

broad-dog-22463

06/27/2019, 12:42 PM
g

glamorous-waitress-51149

06/27/2019, 12:43 PM
b

broad-dog-22463

06/27/2019, 12:44 PM
There are also DotNet User Groups that would happily listen to how to build in Azure with TypeScript
g

glamorous-waitress-51149

07/02/2019, 10:30 AM
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

stocky-spoon-28903

07/02/2019, 2:11 PM
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

glamorous-waitress-51149

07/02/2019, 2:34 PM
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

broad-dog-22463

07/03/2019, 9:37 AM
Ok I have another suggestion about getting vpc @glamorous-waitress-51149
Trying it out now
g

glamorous-waitress-51149

07/03/2019, 9:41 AM
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

broad-dog-22463

07/03/2019, 9:49 AM
so you want the VPC so you can get the Subnets out of the object right?
g

glamorous-waitress-51149

07/03/2019, 9:50 AM
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

broad-dog-22463

07/03/2019, 9:54 AM
👍
ok, @glamorous-waitress-51149 so I have the VPC object using this way instead now
trying one other way to see for compatability
g

glamorous-waitress-51149

07/03/2019, 9:59 AM
thanks 👍
b

broad-dog-22463

07/03/2019, 9:59 AM
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

glamorous-waitress-51149

07/03/2019, 10:07 AM
seems to export ok
b

broad-dog-22463

07/03/2019, 10:07 AM
but you can't use it?
g

glamorous-waitress-51149

07/03/2019, 10:08 AM
privateSubnetIds is empty
b

broad-dog-22463

07/03/2019, 10:09 AM
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

glamorous-waitress-51149

07/03/2019, 10:10 AM
there in console
b

broad-dog-22463

07/03/2019, 10:10 AM
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

glamorous-waitress-51149

07/03/2019, 10:12 AM
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

broad-dog-22463

07/03/2019, 10:12 AM
i am wondering if its the parenting issue wrt to the VPC
g

glamorous-waitress-51149

07/03/2019, 10:17 AM
fyi added a check for public ids too and thats empty too
b

broad-dog-22463

07/03/2019, 10:18 AM
there we are 🙂
Copy code
+ privateSubnets: []
  + publicSubnets : []
    xId           : "vpc-866580ff"
mine are empty too
this feels like a parenting bug
g

glamorous-waitress-51149

07/03/2019, 10:18 AM
ok, glad i’m not being an annoying noob then
b

broad-dog-22463

07/03/2019, 10:19 AM
you 100% are not
legit bug
now whether it's solved by master is the question...
g

glamorous-waitress-51149

07/03/2019, 10:19 AM
🤞
@broad-dog-22463 is there any ETA on the new release?
b

broad-dog-22463

07/03/2019, 10:43 AM
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

glamorous-waitress-51149

07/03/2019, 10:45 AM
👍
b

broad-dog-22463

07/03/2019, 10:52 AM
cheers man - I will see that we look into this
sorry for the hassle!
f

fresh-summer-65887

07/03/2019, 11:13 AM
Cheers for the help here Paul 😉
b

broad-dog-22463

07/03/2019, 11:14 AM
👍
g

glamorous-waitress-51149

07/03/2019, 11:46 AM
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

fresh-summer-65887

07/03/2019, 1:23 PM
@glamorous-waitress-51149 Could we hard code any values in this stack for now?
g

glamorous-waitress-51149

07/03/2019, 1:23 PM
that’s exactly what i’ve just done
🤢
f

fresh-summer-65887

07/03/2019, 1:50 PM
ha
g

glamorous-waitress-51149

07/04/2019, 8:59 AM
ooh i see a new pulumi version is available @broad-dog-22463 is that a coincidence? 🙂
b

broad-dog-22463

07/04/2019, 9:02 AM
Of Pulumi-awsx?
g

glamorous-waitress-51149

07/04/2019, 9:09 AM
no the pulumi binary
b

broad-dog-22463

07/04/2019, 9:10 AM
I think that’s for something else :)
g

glamorous-waitress-51149

07/04/2019, 9:11 AM
thought there might have been a massive roll out of everything 😉
b

broad-dog-22463

07/04/2019, 9:17 AM
nah, not the day before July 4th weekend!
g

glamorous-waitress-51149

07/04/2019, 9:20 AM
b

broad-dog-22463

07/04/2019, 9:20 AM
😄