diff --git a/packages/aws-cdk-lib/aws-eks/lib/cluster.ts b/packages/aws-cdk-lib/aws-eks/lib/cluster.ts index 97163378d5f2f..fd7f11a6a1395 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/cluster.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/cluster.ts @@ -1800,7 +1800,11 @@ export class Cluster extends ClusterBase { * @param options options for creating a new nodegroup */ public addNodegroupCapacity(id: string, options?: NodegroupOptions): Nodegroup { - if (options?.instanceTypes?.some(i => nodeTypeForInstanceType(i) === NodeType.INFERENTIA)) { + const hasInferentiaInstanceType = [ + options?.instanceType, + ...options?.instanceTypes ?? [], + ].some(i => i && nodeTypeForInstanceType(i) === NodeType.INFERENTIA); + if (hasInferentiaInstanceType) { this.addNeuronDevicePlugin(); } return new Nodegroup(this, `Nodegroup${id}`, {