From 90a41d5622857a0bc2ae6e0be19b72b00a609a7d Mon Sep 17 00:00:00 2001 From: Melle van der Linde <118454433+mellevanderlinde@users.noreply.github.com> Date: Thu, 18 Jul 2024 20:14:53 +0200 Subject: [PATCH] feat(ec2): add g6 instance (#30693) ### Issue # (if applicable) Closes #30683 ### Reason for this change G6 instances are not yet supported by CDK L2 ### Description of changes Added G6 instance class ### Description of how you validated changes Added `g6` to existing unit test ### 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* --- packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts | 12 ++++++++++++ packages/aws-cdk-lib/aws-ec2/test/instance.test.ts | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) 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 be22fd69957a1..4a09f956145f7 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts @@ -890,6 +890,16 @@ export enum InstanceClass { */ G5G = 'g5g', + /** + * Graphics-optimized instances, 6th generation + */ + GRAPHICS6 = 'graphics6', + + /** + * Graphics-optimized instances, 6th generation + */ + G6 = 'g6', + /** * Parallel-processing optimized instances, 2nd generation */ @@ -1568,6 +1578,8 @@ export class InstanceType { [InstanceClass.G5]: 'g5', [InstanceClass.GRAPHICS5_GRAVITON2]: 'g5g', [InstanceClass.G5G]: 'g5g', + [InstanceClass.GRAPHICS6]: 'g6', + [InstanceClass.G6]: 'g6', [InstanceClass.PARALLEL2]: 'p2', [InstanceClass.P2]: 'p2', [InstanceClass.PARALLEL3]: 'p3', diff --git a/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts b/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts index bdf7bead7673e..3947bd5481293 100644 --- a/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts +++ b/packages/aws-cdk-lib/aws-ec2/test/instance.test.ts @@ -126,7 +126,7 @@ describe('instance', () => { }); test('instance architecture is correctly discerned for x86-64 instance', () => { // GIVEN - const sampleInstanceClasses = ['c5', 'm5ad', 'r5n', 'm6', 't3a', 'r6i', 'r6a', 'p4de', 'p5', 'm7i-flex']; // A sample of x86-64 instance classes + const sampleInstanceClasses = ['c5', 'm5ad', 'r5n', 'm6', 't3a', 'r6i', 'r6a', 'g6', 'p4de', 'p5', 'm7i-flex']; // A sample of x86-64 instance classes for (const instanceClass of sampleInstanceClasses) { // WHEN