Open jordan-brough opened 2 years ago
vpc.internetGatewayId
will be populated if the VPC has any public subnets.
vpc.internetGatewayId
will be undefined
if the VPC has no subnets or only isolated subnets (see: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html#internetgatewayid).
Your example doesn't indicate what type of subnets the VPC is configured with, so I'm not sure if this is the case for you.
I am unassigning and marking this issue as p2
, which means that we are unable to work on this immediately.
We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization.
Could it be that the from_lookup
method returns an IVpc
object and internet_gateway_id
is not a supported attribute of this class?
When I try I get this error:
/private/tmp/brazil-path/run.runtimefarm/lib/python3.8/site-packages/jsii/_reference_map.py", line 149, in __getattr__
raise AttributeError(f"'%s' object has no attribute '%s'" % (type_info, name))
AttributeError: '<class 'monocdk.Resource'>+<class 'monocdk.aws_ec2._IVpcProxy'>' object has no attribute 'internet_gateway_id'
I've also encountered this issue. I'm trying to lookup the default vpc (via the lookup method) and access the default internet gateway id associated with the default vpc. The IVPC returned from the lookup method doesn't have an internet gateway id.
Hello, is there any info on this? I am also encountering this issue.
Hey I am encountering this issue too. I am trying to do Edge association to associate internet gateway in a vpc I just created with all Public subnets.
const cfnInternetGWRouteTable = new ec2.CfnGatewayRouteTableAssociation(this, 'cfnInternetGWRouteTable', {
routeTableId: IGWRouteTable.attrRouteTableId,
gatewayId: vpc.internetGatewayId,
});
Strange thing is, when I am trying to do a routing using CfnRoute, vpc.internetGatewayId
being undefined is okay but when associating it with a route table, it returns error.
Description
Add the ability to look up the Internet Gateway for a VPC loaded via
Vpc.fromLookup
.Use Case
I'd like to be able to add a subnet route like this:
but
vpc.internetGatewayId
comes back asundefined
for me. Is this expected?Proposed Solution
I believe there is some relevant context here: https://github.com/aws/aws-cdk/issues/5327#issuecomment-961894054
Other information
No response
Acknowledge