Skip to content

(eks): clarify that vpc prop is necessary for subnetSelection prop to work in FargateProfile construct #16349

@peterwoodworth

Description

@peterwoodworth

There's a check in the FargateProfile constructor which only uses the subnetSelection prop if the vpc prop is defined:

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

Metadata

Metadata

Labels

@aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes ServicedocumentationThis is a problem with documentation.feature-requestA feature should be added or improved.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions