From 98e9fbeac3bf35313c9a9bea4e7f33fcb06e2dcf Mon Sep 17 00:00:00 2001 From: Jimmy Gaussen Date: Fri, 15 Mar 2024 23:19:41 +0100 Subject: [PATCH] chore(ec2): dl2q instance type, `IntanceType` fixes (#29481) ### Issue # (if applicable) None ### Reason for this change Follow up to #29427. Added a missing instance type, and minor fixes to the `IntanceType` class ### Description of changes I'd missed an instance type, [`dl2q`](https://aws.amazon.com/ec2/instance-types/dl2q/), which was neither in `us-east-1` or `us-east-2`, but in `us-west-2`. I've also added a couple of missing symbolic names, as well as fixed some differing comments between the key and its symbolic value (e.g. `M3` and `STANDARD3`) I also re-ordered a couple of enum values, when the symbolic value was separated from its match ### Description of how you validated changes Compared the CDK to the SDK to find the missing instance. Programmatically iterated over the comments of `IntanceType` to make sure the comments of the symbolic keys matched the one below. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cdk-lib/aws-ec2/lib/instance-types.ts | 48 ++++++++++++++----- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts index 890363932a68f..d4ee8c47e1d44 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts @@ -223,6 +223,11 @@ export enum InstanceClass { */ MEMORY5_AMD_NVME_DRIVE = 'memory5-amd-nvme-drive', + /** + * Memory optimized instances based on AMD EPYC with local NVME drive, 5th generation + */ + R5AD = 'r5ad', + /** * High memory instances (3TB) based on Intel Xeon Platinum 8176M (Skylake) processors, 1st generation */ @@ -283,11 +288,6 @@ export enum InstanceClass { */ U_24TB1 = 'u-24tb1', - /** - * Memory optimized instances based on AMD EPYC with local NVME drive, 5th generation - */ - R5AD = 'r5ad', - /** * Memory optimized instances that are also EBS-optimized, 5th generation */ @@ -611,20 +611,30 @@ export enum InstanceClass { */ STORAGE_COMPUTE_1 = 'storage-compute-1', + /** + * Storage/compute balanced instances, 1st generation + */ + H1 = 'h1', + /** * High performance computing powered by AWS Trainium */ - TRN1 = 'trn1', + TRAINING_ACCELERATOR1 = 'training-accelerator1', /** * High performance computing powered by AWS Trainium */ - TRN1N = 'trn1n', + TRN1 = 'trn1', /** - * Storage/compute balanced instances, 1st generation + * Network-optimized high performance computing powered by AWS Trainium */ - H1 = 'h1', + TRAINING_ACCELERATOR1_ENHANCED_NETWORK = 'training-accelerator1-enhanced-network', + + /** + * Network-optimized high performance computing powered by AWS Trainium + */ + TRN1N = 'trn1n', /** * I/O-optimized instances, 3rd generation @@ -742,7 +752,7 @@ export enum InstanceClass { MEMORY_INTENSIVE_1_EXTENDED = 'memory-intensive-1-extended', /** - * Memory-intensive instances, 1st generation + * Memory-intensive instances, extended, 1st generation */ X1E = 'x1e', @@ -881,7 +891,7 @@ export enum InstanceClass { P2 = 'p2', /** - * Parallel-processing optimized instances, 3nd generation + * Parallel-processing optimized instances, 3rd generation */ PARALLEL3 = 'parallel3', @@ -891,7 +901,7 @@ export enum InstanceClass { P3 = 'p3', /** - * Parallel-processing optimized instances with local NVME drive for high performance computing, 3nd generation + * Parallel-processing optimized instances with local NVME drive for high performance computing, 3rd generation */ PARALLEL3_NVME_DRIVE_HIGH_PERFORMANCE = 'parallel3-nvme-drive-high-performance', @@ -1199,6 +1209,16 @@ export enum InstanceClass { * Deep learning instances powered by Gaudi accelerators from Habana Labs (an Intel company), 1st generation */ DL1 = 'dl1', + + /** + * Deep learning instances powered by Qualcomm AI 100 Standard accelerators, 2nd generation + */ + DEEP_LEARNING2_QUALCOMM = 'deep-learning2-qualcomm', + + /** + * Deep learning instances powered by Qualcomm AI 100 Standard accelerators, 2nd generation + */ + DL2Q = 'dl2q', } /** @@ -1490,7 +1510,9 @@ export class InstanceType { [InstanceClass.D3]: 'd3', [InstanceClass.STORAGE3_ENHANCED_NETWORK]: 'd3en', [InstanceClass.D3EN]: 'd3en', + [InstanceClass.TRAINING_ACCELERATOR1]: 'trn1', [InstanceClass.TRN1]: 'trn1', + [InstanceClass.TRAINING_ACCELERATOR1_ENHANCED_NETWORK]: 'trn1n', [InstanceClass.TRN1N]: 'trn1n', [InstanceClass.STORAGE_COMPUTE_1]: 'h1', [InstanceClass.H1]: 'h1', @@ -1606,6 +1628,8 @@ export class InstanceType { [InstanceClass.MEMORY_INTENSIVE_2_XTZ_INTEL]: 'x2iezn', [InstanceClass.DEEP_LEARNING1]: 'dl1', [InstanceClass.DL1]: 'dl1', + [InstanceClass.DEEP_LEARNING2_QUALCOMM]: 'dl2q', + [InstanceClass.DL2Q]: 'dl2q', }; return new InstanceType(`${instanceClassMap[instanceClass] ?? instanceClass}.${instanceSize}`); }