Skip to content

Commit

Permalink
Update packages/aws-cdk-lib/aws-eks/lib/cluster.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Luca Pizzini <lpizzini7@gmail.com>
  • Loading branch information
gdamjan and lpizzinidev committed Nov 13, 2023
1 parent 2acd9f3 commit 09c205c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/aws-cdk-lib/aws-eks/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`, {
Expand Down

0 comments on commit 09c205c

Please sign in to comment.