Hi there - I am looking for some help with unexpec...
# aws
b
Hi there - I am looking for some help with unexpected behavior from the
awsx.ec2.Vpc.fromExistingIds()
method:
Copy code
const vpc = awsx.ec2.Vpc.fromExistingIds("vpcFromId", {
        vpcId: configData.vpcId,
    },{provider: provider})
When I run this code against one aws provider, it executes as expected. Against another aws provider, connected to a different account profile, I get the following error:
Copy code
error: Error: invocation of aws:ec2/getVpc:getVpc returned an error: invoking aws:ec2/getVpc:getVpc: 1 error occurred:
        * no matching EC2 VPC found
This is very strange because I can verify that the vpc does exist for this provider (both from the aws console and also from the aws cli) What would cause this behavior?
g
Would the providers happen to connect to different regions, by chance?
b
negative - same region @great-queen-39697
g
Hm. And I'm guessing configData is just a standard array, right? That's odd. Let me spin up a sandbox and try it myself
b
yes that’s right - configData.vpcId returns a string
@great-queen-39697 to clarify - I have seen the method work in other contexts. It’s just this specific provider with this specific aws profile that is showing the issue. Do you know of specific issues with a given profile/aws account that could lead to this problem?
g
I don't, unfortunately. It may be a bug; I can't figure it out myself. Mind opening a bug report? https://github.com/pulumi/pulumi/issues/new?assignees=&labels=kind%2Fbug&template=0-bug-report.md
b
sure
g
thank you! sorry I couldn't be of more help
b