I am trying to import and existing non-default VPC into my CDK app. I have seen a lot of questions asked regrading the VPC fromLookup and not much of solution. I am having issues where the function vpc.fromLookup returns "Could not find any VPCs matching". I have provided these filters, and the env. account and region are set as well in the stack. I just cant figure out why the VPC is not found. I have triple checked the VPC id and Name and it all exists. any help is truly appreciated as I am new to AWS and CDK.
I have also trying just using tagName or VPCId but still got the same error.
[Error at /MyStack] Could not find any VPCs matching {"account":"00000000","region":"ca-central-1","filter":{"tag:aws-cdk:subnet-type":"private","vpc-id":"vpc-00000000","tag:Name":"vpc","isDefault":"false"},"returnAsymmetricSubnets":true} Found errors
const vpc = ec2.Vpc.fromLookup(this, "VPC", { vpcName: vpcName, isDefault: false,
vpcId: vpcId, tags: { "aws-cdk:subnet-type": "private" },
});
env: {
account: process.env.CDK_DEPLOY_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEPLOY_REGION || process.env.CDK_DEFAULT_REGION,
},
Thank you in advance!