VPC: Isolated subnets lists subnets that are not isolated #26143
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
When iterating over
.isolatedSubnets
of a givenvpc
or filtering subnets by.selectSubnets({subnetGroupName: 'Isolated'}
I will get mixed results.Some of the retrieved subnets are isolated, they contain the cdk tags
aws-cdk:subnet-name: Isolated
aws-cdk:subnet-type: Isolated
But other results in this list are not Isolated, they e.g. were manually created and contain only one single
Name
tag that does not contain any phrase ofIsolated
. Also the Network ACL of this very specifics subnets are not similar to the real isolated subnets.Expected Behavior
Both ways of retrieving the isolated subnets should retriev only isolated subnets by at least being consistent with filtering the tag
aws-cdk:subnet-type: Isolated
Current Behavior
It's unclear which criteria are being used to determine a given subnet belongs to the
isolated
subnet category.Reproduction Steps
given a vpc
id=abc
abc
abc
inspect the results of
Possible Solution
as suggested, cdk should filter the subnets by the 2 tags below having the value
Isolated
aws-cdk:subnet-name
aws-cdk:subnet-type
otherwise document the criteria on how cdk determines the subnet type.
Additional Information/Context
No response
CDK CLI Version
2.65.0 (build 5862f7a)
Framework Version
No response
Node.js Version
v18.13.0
OS
linux | macos
Language
Typescript
Language Version
"typescript": "4.6.3"
Other information
The text was updated successfully, but these errors were encountered: