-
Notifications
You must be signed in to change notification settings - Fork 4k
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
VpcNetwork.importFromContext throws Cannot read property 'VpnGatewayId' of undefined #1998
VpcNetwork.importFromContext throws Cannot read property 'VpnGatewayId' of undefined #1998
Comments
Full
|
Problem lies here: packages/aws-cdk/lib/context-providers/vpcs.ts#L88
If there are no VpnGateways, the DescribeVpnGateways SDK call will return an empty array like so:
The ternary operator above should check array size, rather than whether it's defined/null. |
A workaround I found here is using ec2.VpcNetwork.import and not importFromContext |
Check VpnGateways length in VPC provider, which would lead to failure to import VPCs without VPN gateways. Fixes #1998
Now that this is fixed in master, how can I update to that? This totally breaks me... |
We will do a release next week. If you don't want to wait for that, you can check out the repository and do a local build. Be aware, you will need a Linux or mac otherwise the build is going to give you a lot of trouble. |
Versions
Problem Description
I have a very standard public/private VPC deployed (it was previously deployed with CDK).
I'm trying to import that VPC from a new CDK project, like so:
When running
cdk synth
orcdk diff
, an error is shown:I suspect this is related to #1899 that was merged 8 days ago.
Related: #1523 (see comment by @brad-jones)
The text was updated successfully, but these errors were encountered: