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

[aws-ec2] Vpc.fromLookups() should be able to locate x-env VPCs just like Vpc.fromAttributes() can #10208

Closed
efernandes-dev-ops opened this issue Sep 6, 2020 · 2 comments · Fixed by #16728
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1

Comments

@efernandes-dev-ops
Copy link

We are trying to lookup a VPC that is created in another stack. We are able to find the VPC if it's in the same region however, if the vpc is in another region we are unable to find it and an error gets thrown.

Reproduction Steps

vpc = aws-ec2.Vpc.from_lookup(self, id='second_vpc', vpc_id=second_vpc_id, is_default=False)

or

vpc = aws-ec2.Vpc.from_lookup(self, id='second_vpc', vpc_name='second-vpc', is_default=False)

What did you expect to happen?

What actually happened?

Error got thrown:

Could not find any VPCs matching {"account":"324xxxxxxx","region":"eu-west-2","filter":{"vpc-id":"vpc-7xxxxxxx","isDefault":"false"},"returnAsymmetricSubnets":true} Found errors

Environment

  • **CLI Version :1.54.0 (build c01b9b9)
  • Framework Version:
  • **Node.js Version:v12.18.3
  • OS : mac
  • **Language (Version):Python (3.7.3)

Other


This is 🐛 Bug Report

@efernandes-dev-ops efernandes-dev-ops added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 6, 2020
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Sep 6, 2020
@rix0rrr rix0rrr added feature-request A feature should be added or improved. effort/medium Medium work item – several days of effort p1 and removed bug This issue is a bug. labels Sep 7, 2020
@rix0rrr rix0rrr changed the title [aws-ec2] Vpc lookups do not work cross region [aws-ec2] Vpc.fromLookups() should be able to locate x-env VPCs just like Vpc.fromAttributes() can Sep 7, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Nov 6, 2020
@mina-asham
Copy link
Contributor

This seems overly trivial to support, I have a PR here: #16728, let me know if I missed something

@mergify mergify bot closed this as completed in #16728 Oct 25, 2021
mergify bot pushed a commit that referenced this issue Oct 25, 2021
- Currently Vpc.fromLookup will default to the Stack's region, when needing to lookup Stack's from other regions (e.g. for VPC peering) this doesn't work and the only other work around is a custom resource
- The lookup provider already supports passing a region and works fine if you pass one that's not the Stack's inferred region, so just propagate that option to the top level
- Fixes #10208


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@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.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
- Currently Vpc.fromLookup will default to the Stack's region, when needing to lookup Stack's from other regions (e.g. for VPC peering) this doesn't work and the only other work around is a custom resource
- The lookup provider already supports passing a region and works fine if you pass one that's not the Stack's inferred region, so just propagate that option to the top level
- Fixes aws#10208


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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 effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants