Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2: Need G6 EC2 Instance support #30683

Closed
2 tasks
CambioML opened this issue Jun 26, 2024 · 4 comments · Fixed by #30693 or rwlxxvii/containers#185 · May be fixed by gitafolabi/kreuzlaker#2, NOUIY/aws-solutions-constructs#113 or NOUIY/aws-solutions-constructs#114
Closed
2 tasks
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@CambioML
Copy link

Describe the feature

Need G6 EC2 Instance support

Use Case

Need to provision ECS EC2 while using G6 instance

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

^2.1.0

Environment details (OS name and version, etc.)

mac 14.5

@CambioML CambioML added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 26, 2024
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Jun 26, 2024
@ashishdhingra ashishdhingra changed the title (module name): (short issue description) ec2: Need G6 EC2 Instance support Jun 26, 2024
@ashishdhingra ashishdhingra self-assigned this Jun 26, 2024
@ashishdhingra ashishdhingra added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 26, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Jun 26, 2024

Per Amazon EC2 instance types, G6 is one of the supported instance types. However, it not an option in InstanceClass. The probable workaround is to use L1 construct.

@CambioML Thanks for bringing this issue into our attention. Feel free to contribute PR to add G6 EC2 instance type.

@ashishdhingra ashishdhingra added effort/small Small work item – less than a day of effort p1 p2 and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. p1 labels Jun 26, 2024
@ashishdhingra ashishdhingra removed their assignment Jun 26, 2024
@pahud
Copy link
Contributor

pahud commented Jun 26, 2024

@CambioML

Before we have a PR to natively support that, you can override the InstanceType like this:

// create a dummy ec2 instance
    const instance = new ec2.Instance(this, 'Instance', {
      machineImage: ec2.MachineImage.latestAmazonLinux2023(),
      instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.SMALL),
      vpc: ec2.Vpc.fromLookup(this, 'Vpc', { isDefault: true }),
    });

   (instance.node.defaultChild as ec2.CfnInstance).addPropertyOverride('InstanceType', 'g6.xlarge');

verify:

% npx cdk synth dummy-stack1 | grep InstanceType
      InstanceType: g6.xlarge

And you will need to specify appropriate AMI as well.

Let me know if it works for you and we welcome any pull requests for this.

mergify bot pushed a commit that referenced this issue Jul 18, 2024
### 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*
@mergify mergify bot closed this as completed in #30693 Jul 18, 2024
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.