Thread
#aws
    b

    busy-lion-51883

    6 months ago
    Hi there - I am looking for some help with unexpected behavior from the
    awsx.ec2.Vpc.fromExistingIds()
    method:
    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:
    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

    great-queen-39697

    6 months ago
    Would the providers happen to connect to different regions, by chance?
    b

    busy-lion-51883

    6 months ago
    negative - same region @great-queen-39697
    g

    great-queen-39697

    6 months ago
    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

    busy-lion-51883

    6 months ago
    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

    great-queen-39697

    6 months ago
    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

    busy-lion-51883

    6 months ago
    sure
    g

    great-queen-39697

    6 months ago
    thank you! sorry I couldn't be of more help
    b

    busy-lion-51883

    6 months ago