I'm running a `awsx.ec2.Vpc.fromExistingIds` and i...
# general
e
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
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
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
You can do something like:
aws.getCallerIdentity().then(console.log)
e
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
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
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