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

VPC “fromLookup” results in all Private Subnets and no Public Subnets #3405

Closed
saudansari opened this issue Jul 24, 2019 · 1 comment
Closed
Labels
needs-triage This issue or PR still needs to be triaged.

Comments

@saudansari
Copy link

Using CDK v1.1.0 I'm trying to create an internet-facing Application Load Balancer.

When I call the ec2.vpc.fromLookup using my vpcId, i get all my subnets, but all of them come as PRIVATE Subnets. Due to this I get an error that there are no Public Subnets Available.

If I try using ec2.vpc.fromVpcAttributes using my vpcid, availabilityZones and SubnetIDs, i get the error "Cannot read property 'selectSubnets' of undefined".

Route Table of My Subnets: Within the Subnets, my RoutTable has two Routs:

Destination: 10.140.0.0/16, Target: Local, Status Active
Destination: 0.0.0.0/0, Target: internet-gateway, Status Active
I'm not sure whether my subnet/VPC configuration are incorrect or aws-cdk has a bug.

I've manually tried creating an Application Load Balancer with the public subnets and was able to create is successfully. So I can't say my subnet configs are incorrect.

@saudansari saudansari added the needs-triage This issue or PR still needs to be triaged. label Jul 24, 2019
@saudansari
Copy link
Author

turns out it was a combination of two issues:

  1. Public Subnet Attribute Auto-assign public IPv4 address is marked "NO". Changed it to Yes.
  2. Second issue is covered in VPC fromLookup fails with asymmetric subnets  #3407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant