-
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
[@aws-cdk/aws-ec2] subnetselect subnets
are used for filtering instead of being used directly
#10672
Comments
it looks like it was the error message was just essentially misleading. I had the CIDR ranges on the subnets wrong - they did not match the imported VPC. Once I corrected that, the subnets became public subnets. Mismatched CIDR ranges should tell me that they are mismatched, not produce a subnet that can't be used. |
I take back the last comment, I had removed the elb lines and continued to get the same error. Fixing the CIDR blocks got rid of that, so I thought the problem solved. I commented however before I put the call to new elbv2.NetworkLoadBalancer() back. when I did, the error returned. So something more complicated is going on that I haven't isolated yet. |
The issue is probably because I agree that this is not intuitive. |
subnets
are used for filtering instead of being used directl8y
subnets
are used for filtering instead of being used directl8ysubnets
are used for filtering instead of being used directly
so I rather naively thought the ec2.Vpc.fromVpcAttributes was using the attributes listed to identify the VPC to import, and then would discover things about the VPC to fill in the rest of the object's properties. It did not occur to me that anything I did not specify in that call would end up blank. Is that something that I missed in the documentation? |
You were probably looking for this: https://docs.aws.amazon.com/cdk/api/latest/docs/aws-ec2-readme.html#importing-an-existing-vpc |
I did start with that function, but I read somewhere in the docs that functions that depend on context do not work well with codepipelines and codebuild yet. |
Well. It's not at the location where we'd like it to be vis-a-vis cross-account queries, but as long as you stay within an account (or have access to the target account's credentials), you can do a |
Probably relevant for #5927 |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
new NetworkLoadBalancer is not detecting public subnets.
Reproduction Steps
I also tried to let it pick subnets by itse,f (no vpcSubnets attribute for the NetworkLoadBalancer) and get the same behavior.
What did you expect to happen?
I expect that since I created these brand new subnets using the PublicSubnet constructor, that they would be valid as pubic subnets for NetworkLoadBalancer.
What actually happened?
$ npx cdk synth
There are no 'Public' subnet groups in this VPC. Available types:
Subprocess exited with error 1
Environment
aws/codebuild/standard:4.0 on Linux and Ubuntu 20.04.1 LTS
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: