-
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): blockDevice property #4781
Conversation
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
|
@@ -938,162 +922,6 @@ export interface MetricTargetTrackingProps extends BaseTargetTrackingProps { | |||
readonly targetValue: number; | |||
} | |||
|
|||
export interface BlockDevice { |
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'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)[];
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.
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 CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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'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.
@rix0rrr I ended up inheriting everything but the |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
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 {} |
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.
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?
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.
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.
I would not mind at all. |
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
|
5 similar comments
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
|
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
|
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
|
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
|
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
|
Superseded by new PR. |
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.
Add
blockDevice
property to EC2Instance
,using previous
aws-autoscaling
's previous implementationBREAKING CHANGES:
BlockDevice*
classes, interfaces and enums to fromaws-autoscaling
package toaws-ec2
Fixes #4773
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license