Skip to content

Commit

Permalink
chore(ec2): add missing instance types (#29427)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

Closes #23854

### Reason for this change

Update the CDK EC2 instance class and size enums to match the current availability

### Description of changes

Added the missing instance class and sizes

### Description of how you validated changes

This was generated with the help of the same tool I used to create #29422, using the live SDK data to match against the CDK. For the instance types, I am using the `DescribeInstanceTypes` API command in multiple regions (`us-east-1`, `us-east-2`, `us-west-1`, `eu-west-1`.) As far as I could tell, the union of `us-east-1` and `us-east-2` cover all possible instance classes and sizes, but correct me if I'm wrong.

As a sanity check, I'm also checking that the CDK does not have more instance types and sizes that the SDK does. It does vary between regions, but of note, there were:
* `p4de`, in developer preview
* `x2g`, RDS exclusive and not returned by `DescribeInstanceTypes`

Finally, I am ignoring some of the previous generation instance classes missing from the CDK, as they are very outdated and weren't added in first place, i.e. `c1`, `t1`, `m1`, `m2`, and `i2`.

### 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*
  • Loading branch information
nmussy authored Mar 11, 2024
1 parent bf33efd commit 840ec97
Showing 1 changed file with 98 additions and 1 deletion.
99 changes: 98 additions & 1 deletion packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,36 @@ export enum InstanceClass {
*/
MAC1 = 'mac1',

/**
* Macintosh instances built on Apple Mac mini 2020 computers, 2nd generation with Apple silicon M1 processors
*/
MACINTOSH2_M1 = 'macintosh2-m1',

/**
* Macintosh instances built on Apple Mac mini 2020 computers, 2nd generation with Apple silicon M1 processors
*/
MAC2 = 'mac2',

/**
* Macintosh instances built on Apple Mac mini 2023 computers, 2nd generation with Apple silicon M2 processors
*/
MACINTOSH2_M2 = 'macintosh2-m2',

/**
* Macintosh instances built on Apple Mac mini 2023 computers, 2nd generation with Apple silicon M2 processors
*/
MAC2_M2 = 'mac2-m2',

/**
* Macintosh instances built on Apple Mac mini 2023 computers, 2nd generation with Apple silicon M2 Pro processors
*/
MACINTOSH2_M2_PRO = 'macintosh2-m2-pro',

/**
* Macintosh instances built on Apple Mac mini 2023 computers, 2nd generation with Apple silicon M2 Pro processors
*/
MAC2_M2PRO = 'mac2-m2pro',

/**
* Multi-stream video transcoding instances for resolutions up to 4K UHD, 1st generation
*/
Expand All @@ -1130,6 +1160,36 @@ export enum InstanceClass {
*/
HPC6A = 'hpc6a',

/**
* High performance computing with local NVME drive based on 6th generation with Intel Xeon Scalable processors (3rd generation processors code named Ice Lake), 6th generation
*/
HIGH_PERFORMANCE_COMPUTING6_INTEL_NVME_DRIVE = 'high-performance-computing6-intel-nvme-drive',

/**
* High performance computing with local NVME drive based on 6th generation with Intel Xeon Scalable processors (3rd generation processors code named Ice Lake), 6th generation
*/
HPC6ID = 'hpc6id',

/**
* High performance computing based on AMD EPYC, 7th generation
*/
HIGH_PERFORMANCE_COMPUTING7_AMD = 'high-performance-computing7-amd',

/**
* High performance computing based on AMD EPYC, 7th generation
*/
HPC7A = 'hpc7a',

/**
* High performance computing based on Graviton, 7th generation
*/
HIGH_PERFORMANCE_COMPUTING7_GRAVITON = 'high-performance-computing7-graviton',

/**
* High performance computing based on Graviton, 7th generation
*/
HPC7G = 'hpc7g',

/**
* Deep learning instances powered by Gaudi accelerators from Habana Labs (an Intel company), 1st generation
*/
Expand Down Expand Up @@ -1261,14 +1321,39 @@ export enum InstanceSize {
XLARGE56 = '56xlarge',

/**
* Instance size XLARGE56 (112xlarge)
* Instance size XLARGE96 (96xlarge)
*/
XLARGE96 = '96xlarge',

/**
* Instance size XLARGE112 (112xlarge)
*/
XLARGE112 = '112xlarge',

/**
* Instance size METAL (metal)
*/
METAL = 'metal',

/**
* Instance size XLARGE16METAL (metal-16xl)
*/
XLARGE16METAL = 'metal-16xl',

/**
* Instance size XLARGE24METAL (metal-24xl)
*/
XLARGE24METAL = 'metal-24xl',

/**
* Instance size XLARGE32METAL (metal-32xl)
*/
XLARGE32METAL = 'metal-32xl',

/**
* Instance size XLARGE48METAL (metal-48xl)
*/
XLARGE48METAL = 'metal-48xl',
}

/**
Expand Down Expand Up @@ -1495,10 +1580,22 @@ export class InstanceType {
[InstanceClass.INF2]: 'inf2',
[InstanceClass.MACINTOSH1_INTEL]: 'mac1',
[InstanceClass.MAC1]: 'mac1',
[InstanceClass.MACINTOSH2_M1]: 'mac2',
[InstanceClass.MAC2]: 'mac2',
[InstanceClass.MACINTOSH2_M2]: 'mac2-m2',
[InstanceClass.MAC2_M2]: 'mac2-m2',
[InstanceClass.MACINTOSH2_M2_PRO]: 'mac2-m2pro',
[InstanceClass.MAC2_M2PRO]: 'mac2-m2pro',
[InstanceClass.VIDEO_TRANSCODING1]: 'vt1',
[InstanceClass.VT1]: 'vt1',
[InstanceClass.HIGH_PERFORMANCE_COMPUTING6_AMD]: 'hpc6a',
[InstanceClass.HPC6A]: 'hpc6a',
[InstanceClass.HIGH_PERFORMANCE_COMPUTING6_INTEL_NVME_DRIVE]: 'hpc6id',
[InstanceClass.HPC6ID]: 'hpc6id',
[InstanceClass.HIGH_PERFORMANCE_COMPUTING7_AMD]: 'hpc7a',
[InstanceClass.HPC7A]: 'hpc7a',
[InstanceClass.HIGH_PERFORMANCE_COMPUTING7_GRAVITON]: 'hpc7g',
[InstanceClass.HPC7G]: 'hpc7g',
[InstanceClass.I4I]: 'i4i',
[InstanceClass.IO4_INTEL]: 'i4i',
[InstanceClass.X2IEDN]: 'x2iedn',
Expand Down

0 comments on commit 840ec97

Please sign in to comment.