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

feat(ec2): Support for new EBS types #12074

Merged
merged 13 commits into from
Jan 21, 2021

Conversation

leandrodamascena
Copy link
Contributor

closes #12071

Added new EBS types released in re:Invent 2020 and fixed some documentation problems. Some observations:

./packages/@aws-cdk/aws-elasticsearch/lib/domain.ts - The Elasticsearch service allows only General Purpose, Provisioned IOPS and Magnetic.
./packages/@aws-cdk/aws-rds/lib/instance.ts - Storage types and the official link were added

For compatibility reasons, I kept the " GENERAL_PURPOSE_SSD" as GP2 and created a new type called "GENERAL_PURPOSE_SSD_GP3" for GP3. The same happened to IO1/IO2. Please let me know if it is correct, I think it is the best way to not break stacks that already exist with these definitions.

@NetaNir

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Added new EBS types released in re:Invent 2020 and fixed some documentation problems closes aws#12071
@gitpod-io
Copy link

gitpod-io bot commented Dec 14, 2020

@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Dec 14, 2020
@leandrodamascena
Copy link
Contributor Author

PR Linter checked failed, but I don't know what I need to add to the README file. There is no section talking about EBS Types in all the packages I changed.

Please let me know and I can change. Ty.

@NetaNir NetaNir added the pr-linter/exempt-readme The PR linter will not require README changes label Dec 14, 2020
@NetaNir NetaNir self-assigned this Dec 27, 2020
Copy link
Contributor

@NetaNir NetaNir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting it. A few comments about the docs, and lets remove all the added tests

@@ -338,6 +338,25 @@ nodeunitShim({
test.done();
},

'volume: io2'(test: Test) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is nothing special about the volume type, there is no need to add a unit test for it. Given the large number of types, adding a test for each one will increase the overall tests execution time without providing additional value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'm going to remove this test and all the others! As I saw tests with specific volume types, I considered it important for the process. But it makes sense not to increase the execution time of the tests.

@@ -226,7 +247,7 @@ nodeunitShim({

// THEN
test.deepEqual(instance.node.metadata[0].type, cxschema.ArtifactMetadataEntryType.WARN);
test.deepEqual(instance.node.metadata[0].data, 'iops will be ignored without volumeType: EbsDeviceVolumeType.IO1');
test.deepEqual(instance.node.metadata[0].data, 'iops will be ignored without volumeType: EbsDeviceVolumeType.IO1 or EbsDeviceVolumeType.IO2');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This warning is confusing. From the code it seems like setting volumeType to EbsDeviceVolumeType.IO2 without setting iops is not allowed, but the warning implies the other way around?

Same comment as below, if this test is not adding any value we shouldn't add it.

If these were added to satisfy the linter rule, note that I have added an exempt label so it will not block the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! As the comment above, I'll remove this test too.

@NetaNir NetaNir added the pr-linter/exempt-test The PR linter will not require test changes label Dec 28, 2020
@mergify mergify bot dismissed NetaNir’s stale review December 28, 2020 20:57

Pull request has been modified.

@leandrodamascena
Copy link
Contributor Author

Thanks for submitting it. A few comments about the docs, and lets remove all the added tests

I removed all the added tests and committed again. Let me know if I need to change anything else.

rix0rrr
rix0rrr previously approved these changes Jan 6, 2021
@mergify mergify bot dismissed rix0rrr’s stale review January 20, 2021 22:49

Pull request has been modified.

NetaNir
NetaNir previously approved these changes Jan 20, 2021
Removed Trailing spaces. closes aws#12071
@mergify mergify bot dismissed NetaNir’s stale review January 20, 2021 23:37

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Jan 21, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Jan 21, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 4279fba
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 6a2ce55 into aws:master Jan 21, 2021
mohanrajendran pushed a commit to mohanrajendran/aws-cdk that referenced this pull request Jan 24, 2021
closes aws#12071

Added new EBS types released in re:Invent 2020 and fixed some documentation problems.  Some observations:

./packages/@aws-cdk/aws-elasticsearch/lib/domain.ts - The Elasticsearch service allows only General Purpose, Provisioned IOPS and Magnetic. 
./packages/@aws-cdk/aws-rds/lib/instance.ts - Storage types and the official link were added

For compatibility reasons, I kept the " GENERAL_PURPOSE_SSD" as GP2 and created a new type called "GENERAL_PURPOSE_SSD_GP3" for GP3. The same happened to IO1/IO2. Please let me know if it is correct, I think it is the best way to not break stacks that already exist with these definitions.

@NetaNir 
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mergify bot pushed a commit that referenced this pull request Feb 9, 2021
Fixes #12816.

* add validation: must specify `iops` if `volumeType` is `io1` or `io2`
* fix validation: `iops` may only be specified if the `volumeType` is `io1`, `io2` or `gp3`
* fix validation: `iops` minimum & maximum for `io1`, `io2` and `gp3` respectively
* fix validation: `iops` maximum ratio (IOPS/Gib) for `io1`, `io2` and `gp3` respectively
* fix validation: `multi-attach` is supported exclusively on `io1` and `io2` volumes.
* fix validation: `size` minimum & maximum for all `volumeType` (including `gp3` and `io2` which was a bug specified in #12816)

Unit tests are either added / fixed for above changes.

References:
#12074
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TLadd pushed a commit to TLadd/aws-cdk that referenced this pull request Feb 9, 2021
Fixes aws#12816.

* add validation: must specify `iops` if `volumeType` is `io1` or `io2`
* fix validation: `iops` may only be specified if the `volumeType` is `io1`, `io2` or `gp3`
* fix validation: `iops` minimum & maximum for `io1`, `io2` and `gp3` respectively
* fix validation: `iops` maximum ratio (IOPS/Gib) for `io1`, `io2` and `gp3` respectively
* fix validation: `multi-attach` is supported exclusively on `io1` and `io2` volumes.
* fix validation: `size` minimum & maximum for all `volumeType` (including `gp3` and `io2` which was a bug specified in aws#12816)

Unit tests are either added / fixed for above changes.

References:
aws#12074
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
NovakGu pushed a commit to NovakGu/aws-cdk that referenced this pull request Feb 18, 2021
Fixes aws#12816.

* add validation: must specify `iops` if `volumeType` is `io1` or `io2`
* fix validation: `iops` may only be specified if the `volumeType` is `io1`, `io2` or `gp3`
* fix validation: `iops` minimum & maximum for `io1`, `io2` and `gp3` respectively
* fix validation: `iops` maximum ratio (IOPS/Gib) for `io1`, `io2` and `gp3` respectively
* fix validation: `multi-attach` is supported exclusively on `io1` and `io2` volumes.
* fix validation: `size` minimum & maximum for all `volumeType` (including `gp3` and `io2` which was a bug specified in aws#12816)

Unit tests are either added / fixed for above changes.

References:
aws#12074
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(ec2): Support for new EBS types released in re:Invent 2020.
4 participants