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): Implement UserData methods in MultipartUserData #14347

Merged
merged 3 commits into from
Jun 4, 2021

Conversation

ddneilson
Copy link
Contributor

Implements: #14346


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

@gitpod-io
Copy link

gitpod-io bot commented Apr 23, 2021

@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Apr 23, 2021
* as a shell script. The UserData added by this method will also be the target
* of calls to the `add*Command` methods on this MultipartUserData object.
*/
public addUserDataPartForCommands(userData: UserData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would prefer the first invocation of adduserDataPart() to trigger this behavior, optionally gated by a makeDefault?: boolean parameter (which defaults to true if no default has been set yet and defaults to false if a default has already been set).

This additional method also feels awkward.

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 like it. I'll get a rev up with the change.

@@ -436,13 +436,15 @@ export interface MultipartUserDataOptions {
*
*/
export class MultipartUserData extends UserData {
private static readonly USE_PART_ERROR = 'MultipartUserData does not support this operation. Please add part using addPart.';
private static readonly USE_PART_ERROR = 'MultipartUserData does not support this operation. Please use addUserDataPartForCommands().';
Copy link
Contributor

Choose a reason for hiding this comment

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

The error message could be more helpful about the behavior. How about:

MultipartUserData only supports this operation if it has a default UserData. Call addUserDataPart with makeDefault=true

@ddneilson ddneilson force-pushed the neilsd/multipart_ud_methods_support branch from a59bce7 to 1f153ec Compare May 10, 2021 14:45
@gitpod-io
Copy link

gitpod-io bot commented May 10, 2021

@mergify mergify bot dismissed rix0rrr’s stale review May 10, 2021 14:49

Pull request has been modified.

@ddneilson
Copy link
Contributor Author

Just fyi, @rix0rrr , the changes have been made & this is ready for you to take another pass at it.

@ddneilson
Copy link
Contributor Author

@rix0rrr Just a reminder poke that this is waiting on you.

@mergify
Copy link
Contributor

mergify bot commented Jun 4, 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: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 6784631
  • 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 d1b6ce4 into aws:master Jun 4, 2021
@mergify
Copy link
Contributor

mergify bot commented Jun 4, 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).

hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
Implements: aws#14346

----

*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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants