-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(eks): clarify that vpc prop is necessary for subnetSelection prop to work in FargateProfile construct #16349
Copy link
Copy link
Labels
@aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes ServiceRelated to Amazon Elastic Kubernetes ServicedocumentationThis is a problem with documentation.This is a problem with documentation.feature-requestA feature should be added or improved.A feature should be added or improved.p1
Description
There's a check in the FargateProfile constructor which only uses the subnetSelection prop if the vpc prop is defined:
aws-cdk/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts
Lines 159 to 163 in 6c15150
| let subnets: string[] | undefined; | |
| if (props.vpc) { | |
| const selection: ec2.SubnetSelection = props.subnetSelection ?? { subnetType: ec2.SubnetType.PRIVATE }; | |
| subnets = props.vpc.selectSubnets(selection).subnetIds; | |
| } |
However our docs don't make this clear, which lead to customer confusion from having all of their private subnets be selected. We should clarify that the vpc prop also needs to be defined for the subnetSelection prop to work.
Additionally, we could throw an error if the subnetSelection prop is defined and the vpc isn't, but I'm not sure if that would be a breaking change.
This is a 📕 documentation issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes ServiceRelated to Amazon Elastic Kubernetes ServicedocumentationThis is a problem with documentation.This is a problem with documentation.feature-requestA feature should be added or improved.A feature should be added or improved.p1