Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ec2] keep getting vpc-12345 from vpc lookup #11576

Closed
david2003542 opened this issue Nov 19, 2020 · 4 comments
Closed

[ec2] keep getting vpc-12345 from vpc lookup #11576

david2003542 opened this issue Nov 19, 2020 · 4 comments
Assignees
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@david2003542
Copy link

I created a stack and add in into codepipeline stage. Inside this stack I was using vpc lookup function as below

const vpc: ec2.IVpc = ec2.Vpc.fromLookup(this, "vpcId", {
            vpcId: "vpc-xxx"
        });

const sg = ec2.SecurityGroup.fromSecurityGroupId(this, 'SecurityGroup', 'sg-yyyyyy')

For some reason, I always got vpc-12345 from the template. I have no idea why.
However, In the security group section I can get the correct one.
Therefore, I believe they are using same props with same account and region

For more detail, I do check the vpcId in the AWS console. It does exsist.

This is 🐛 Bug Report

@david2003542 david2003542 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 19, 2020
@hoegertn
Copy link
Contributor

Are you trying to use CDK pipelines? They do not support lookups yet.
You have to synth locally once and commit the cdk.context.json to the repo. Then it should be picked up correctly.

@SomayaB SomayaB changed the title [vpc-cdk] [ec2] keep getting vpc-12345 from vpc lookup Nov 20, 2020
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Nov 20, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 23, 2020

You are being affected by #11631.

What Thorsten suggests will work, assuming your CDK version has this commit in it: a4a555a (which will be the next release).

@rix0rrr rix0rrr closed this as completed Nov 23, 2020
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@maggoun
Copy link

maggoun commented May 2, 2023

Are you trying to use CDK pipelines? They do not support lookups yet. You have to synth locally once and commit the cdk.context.json to the repo. Then it should be picked up correctly.

Hi, im also getting vpc-12345 when making the below call:

        var vpc = Vpc.FromLookup(this, canamVpc, new VpcLookupOptions()
        {
            VpcName = "MyVPC"

        });

will this be fixed to work in cdk codepipelines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants