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

early-musician-41645

10/28/2019, 11:42 PM
I'm running a
awsx.ec2.Vpc.fromExistingIds
and it works as expected in a different project.
Copy code
Error: invocation of aws:ec2/getVpc:getVpc returned an error: invoking aws:ec2/getVpc:getVpc: no matching VPC found
Is there a flag or something I'm missing? The VPC id definitely exists.
w

white-balloon-205

10/28/2019, 11:45 PM
Only thing I can think of is that you are somehow in a different account? Are you passing explicit provider information to either of the calls? Have you passed the same configuration into both stacks for the AWS role/account to use?
e

early-musician-41645

10/28/2019, 11:46 PM
I'm just using the account setup from the shell. When I do
sts get-caller-identity
it is set up properly.
How can I log the current aws role/account used by Pulumi?
w

white-balloon-205

10/28/2019, 11:50 PM
You can do something like:
aws.getCallerIdentity().then(console.log)
e

early-musician-41645

10/28/2019, 11:52 PM
the logged ID looks exactly right, and the vpcId I'm using looks right. Here's the code:
Copy code
const vpcId = tentacleConfig.require("vpcId");
console.log("vpcId: "+vpcId);
export const vpc = awsx.ec2.Vpc.fromExistingIds("tentacle-vpc", {
  vpcId: vpcId,
});
I thought I had the syntax wrong, but the same code in another project works okay
w

white-balloon-205

10/28/2019, 11:55 PM
Pretty hard to tell for sure - seems it almost has to be that somehow you are using a different account. To debug further - you could run
TF_LOG=TRACE pulumi up --debug
(and may need to pipe that output to a file as it will be quite verbose). You can then see the exact calls being made to AWS.
e

early-musician-41645

10/28/2019, 11:57 PM
I see the
DescribeVpcsResponse
and it has the exact same
vpcId
that I'm using in the config... 😕
Although, I do see an earlier call with an empty
vpcSet
, but later calls with it filled in
7 Views