We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1187366 commit e1a1a7bCopy full SHA for e1a1a7b
packages/aws-cdk/lib/context-providers/vpcs.ts
@@ -85,7 +85,9 @@ export class VpcNetworkContextProviderPlugin implements ContextProviderPlugin {
85
}
86
]
87
}).promise();
88
- const vpnGatewayId = vpnGatewayResponse.VpnGateways ? vpnGatewayResponse.VpnGateways[0].VpnGatewayId : undefined;
+ const vpnGatewayId = vpnGatewayResponse.VpnGateways && vpnGatewayResponse.VpnGateways.length === 1
89
+ ? vpnGatewayResponse.VpnGateways[0].VpnGatewayId
90
+ : undefined;
91
92
return {
93
vpcId,
0 commit comments