Skip to content

Commit

Permalink
feat(ec2): Add support for P5 instances EC2 (#27705)
Browse files Browse the repository at this point in the history
The P5 instance types were introduced in [July 2023](https://aws.amazon.com/blogs/aws/new-amazon-ec2-p5-instances-powered-by-nvidia-h100-tensor-core-gpus-for-accelerating-generative-ai-and-hpc-applications/).
The instance types are supported in [CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-instance.html#cfn-ec2-instance-instancetype).


Closes #27704.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
niroam authored Nov 2, 2023
1 parent 23b8f8f commit c3357ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,16 @@ export enum InstanceClass {
*/
P4D = 'p4d',

/**
* Parallel-processing optimized instances, 5th generation
*/
PARALLEL5 = 'parallel5',

/**
* Parallel-processing optimized instances, 5th generation
*/
P5 = 'p5',

/**
* Arm processor based instances, 1st generation
*/
Expand Down Expand Up @@ -1391,6 +1401,8 @@ export class InstanceType {
[InstanceClass.P4DE]: 'p4de',
[InstanceClass.PARALLEL4]: 'p4d',
[InstanceClass.P4D]: 'p4d',
[InstanceClass.PARALLEL5]: 'p5',
[InstanceClass.P5]: 'p5',
[InstanceClass.ARM1]: 'a1',
[InstanceClass.A1]: 'a1',
[InstanceClass.STANDARD6_GRAVITON]: 'm6g',
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-ec2/test/instance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('instance', () => {
});
test('instance architecture is correctly discerned for x86-64 instance', () => {
// GIVEN
const sampleInstanceClasses = ['c5', 'm5ad', 'r5n', 'm6', 't3a', 'r6i', 'r6a', 'p4de']; // A sample of x86-64 instance classes
const sampleInstanceClasses = ['c5', 'm5ad', 'r5n', 'm6', 't3a', 'r6i', 'r6a', 'p4de', 'p5']; // A sample of x86-64 instance classes

for (const instanceClass of sampleInstanceClasses) {
// WHEN
Expand Down

0 comments on commit c3357ad

Please sign in to comment.