aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

ec2.Vpc.from_lookup fails to recognise any private subnets

Open reeseyc opened this issue 7 years ago • 2 comments

I'm submitting a :beetle: bug report

What is the current behavior?

When utilising an exisiting VPC to deploy, ec2.Vpc.from_lookup will fail to recognise any subnets other than the public subnets. Any further attempt to deploy components to a Private subnet (through choice or design) will therefore fail

For instance:

eks cluster will not create as no private subnet ecs cluster will not create as no private subnet autoscaling group with subnet type set to private will not create

What is the expected behavior (or behavior of feature suggested)? Private subnets should be detected by ec2.Vpc.from_lookup

OS: Windows 10

cdk --version

1.1.0 (build 1a11e96)

python --version

Python 3.7.4

reeseyc avatar Jul 25 '19 23:07 reeseyc

Can you run describe-vpcs, describe-subnets and describe-route-tables on your VPC and post the results here?

Can you show the snippet you are using to import your VPC?

rix0rrr avatar Aug 28 '19 10:08 rix0rrr

@rix0rrr apologies i should have closed this. This is the same issue as #3706 the issue is cause by the fact that the subnets need to be tagged for VPCfromlookup to work; if you created the vpc outside of CDK then you need to add subnet tagging I feel this is a documentation issue and should be clarified in the API reference that VPCfromSubnet requires these values to work

reeseyc avatar Aug 28 '19 10:08 reeseyc