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): blockDevice property #4781

Closed
wants to merge 8 commits into from
Closed

feat(ec2): blockDevice property #4781

wants to merge 8 commits into from

Conversation

nmussy
Copy link
Contributor

@nmussy nmussy commented Oct 31, 2019

Add blockDevice property to EC2 Instance,
using previous aws-autoscaling's previous implementation

BREAKING CHANGES:

  • Move BlockDevice* classes, interfaces and enums to from aws-autoscaling package to aws-ec2

Fixes #4773


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

@nmussy nmussy requested a review from rix0rrr as a code owner October 31, 2019 10:05
@mergify
Copy link
Contributor

mergify bot commented Oct 31, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@@ -938,162 +922,6 @@ export interface MetricTargetTrackingProps extends BaseTargetTrackingProps {
readonly targetValue: number;
}

export interface BlockDevice {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not thrilled about this breaking change, but I couldn't find a way to cleanly deprecate asg.BlockDevice, as it would require the following type for AutoScalingGroupProps:

readonly blockDevices?: (asg.BlockDevice | ec2.BlockDevice)[];

Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't asg.BlockDevice just be more-or-less a copy of ec2.BlockDevice?

I agree, not ideal, but at least not a breaking change.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

rix0rrr
rix0rrr previously requested changes Nov 1, 2019
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

I'd rather you copy/paste the structs. Maybe put them in a separate file with a note to say they're copies that exist for backwards compatibility.

For bonus points, @deprecate the existing types and property and maybe add a property called something like ec2BlockDevices which is the appropriate type (imported from ec2).

As long as we can find ways to not break customers, I want to do that. Let's not take our contract lightly.

@mergify mergify bot dismissed rix0rrr’s stale review November 5, 2019 09:25

Pull request has been modified.

@nmussy
Copy link
Contributor Author

nmussy commented Nov 5, 2019

@rix0rrr I ended up inheriting everything but the EbsDeviceVolumeType enum. I'm not a fan of ec2BlockDevices though. Would you mind keeping this as is, without deprecations?

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

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

export interface EbsDeviceOptions extends ec2.EbsDeviceOptions {}
export interface EbsDeviceOptionsBase extends ec2.EbsDeviceOptionsBase {}
export interface EbsDeviceProps extends ec2.EbsDeviceProps {}
export interface EbsDeviceSnapshotOptions extends ec2.EbsDeviceSnapshotOptions {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's an issue with the interfaces. JSII complains if I attempt to export them:

@aws-cdk/aws-autoscaling: error: [awslint:no-unused-type:@aws-cdk/aws-autoscaling.EbsDeviceOptions] type or enum is not used by exported classes (declared at lib/auto-scaling-group.ts:926)
@aws-cdk/aws-autoscaling: error: [awslint:no-unused-type:@aws-cdk/aws-autoscaling.EbsDeviceOptionsBase] type or enum is not used by exported classes (declared at lib/auto-scaling-group.ts:927)
@aws-cdk/aws-autoscaling: error: [awslint:no-unused-type:@aws-cdk/aws-autoscaling.EbsDeviceProps] type or enum is not used by exported classes (declared at lib/auto-scaling-group.ts:928)
@aws-cdk/aws-autoscaling: error: [awslint:no-unused-type:@aws-cdk/aws-autoscaling.EbsDeviceSnapshotOptions] type or enum is not used by exported classes (declared at lib/auto-scaling-group.ts:929)
@aws-cdk/aws-autoscaling: error: [awslint:no-unused-type:@aws-cdk/aws-autoscaling.EbsDeviceVolumeType] type or enum is not used by exported classes (declared at lib/auto-scaling-group.ts:933)

Copy-pasta time?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. asg.BlockDevice doesn't use asg.EbsDeviceOptions, it uses ec2.EbsDeviceOptions, and so on.

I agree it's not great, but it's practical, and importantly: non-breaking.

@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 6, 2019

Would you mind keeping this as is, without deprecations?

I would not mind at all.

@mergify
Copy link
Contributor

mergify bot commented Dec 16, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

5 similar comments
@mergify
Copy link
Contributor

mergify bot commented Dec 16, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@mergify
Copy link
Contributor

mergify bot commented Dec 16, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@mergify
Copy link
Contributor

mergify bot commented Dec 16, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@mergify
Copy link
Contributor

mergify bot commented Dec 16, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@mergify
Copy link
Contributor

mergify bot commented Dec 16, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@rix0rrr
Copy link
Contributor

rix0rrr commented Dec 27, 2019

Superseded by new PR.

@rix0rrr rix0rrr closed this Dec 27, 2019
rix0rrr added a commit that referenced this pull request Jan 6, 2020
Add `blockDevice` property to EC2 `Instance`, based on `aws-autoscaling`s previous implementation.

We can't unify the two implementations, as that will break API compatibility. Hence, the two libraries have different types for specifying block devices.

Continuation of old PR by @nmussy  for which the source branch has disappeared.

Fixes #4773, closes #4781.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to create EC2 with custom storage size
3 participants