-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(ec2): support for the credit configuration mode for burstable instances #28728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR.
The implementation looks good. I made some comments.
|
||
/** | ||
* Specifying the CPU credit type for burstable EC2 instance types (T2, T3, T3a, etc). | ||
* T3 instances with `host` tenancy do not support the unlimited CPU credit option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document appears to be taken from the L1 or CFn text.
The host
here refers to the tenancy
property of CfnInstanceProps
, which is not visible in the L2 construct. Wouldn't it therefore be more appropriate to use the word dedicated host
?
Otherwise, users may be get confused (like me).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@go-to-k
Indeed, you're right. I've updated the sentence, so please check it.
|
||
/** | ||
* Specifying the CPU credit type for burstable EC2 instance types (T2, T3, T3a, etc). | ||
* T3 instances with `host` tenancy do not support the unlimited CPU credit option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@@ -370,6 +379,11 @@ export class Instance extends Resource implements IInstance { | |||
throw new Error('Cannot specify both of \'keyName\' and \'keyPair\'; prefer \'keyPair\''); | |||
} | |||
|
|||
// if credit specification is set, then the instance type must be burstable | |||
if (props.creditSpecification && !props.instanceType.isBurstable()) { | |||
throw new Error(`creditSpecification is not supported for ${props.instanceType.toString()} instance type`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about outputting which instance types are supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there are already tests for Nat instances, how about putting them in here instead of adding new files? If they are scattered, the contributors will not know which file to put them in when adding tests for Nat instances in the future.
(But if you have a particular intention, I will respect that.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't noticed the existing test code. Thank you for your suggestion.
2f6b436
to
06a904c
Compare
@go-to-k Thank you for your review! I have addressed your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your change, I made some comments again.
@go-to-k Thank you! I have made the revisions again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto <24818752+go-to-k@users.noreply.github.com>
0a2e48d
to
779fe6d
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
In this PR, I have enabled the setting of the credit configuration mode for EC2 instances and NAT instances in burstable performance instances.
Closes #19166.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license