-
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): adds persist option to user data on windows instances #21709
Conversation
Regarding the PR Linter failure -- not adding an integ test. Does it really make sense to add one for this PR? It's not changing/adding any resources/constructs; it's adding functionality to a helper class. |
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.
Thank you for your contribution! I have a couple comments inline. In regard to the integration test, I'd like to see one where this function is called for the construct to show both that the output is what we expect when it's called and also to ensure that this deploys successfully when the function is used (i.e. running the test without using --dry-run
).
* | ||
* @param value If true then the userdata is persisted. (Windows only) | ||
*/ | ||
public abstract persist(value: boolean): void; |
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.
Given that half of the locations of this function throw errors when called, I don't think this is the right level of abstraction. I'm also not sure about this contract as a whole. Since this is a function, not a field, calling it implies that the user wants their data to persist. Given that, it seem that the boolean should be unnecessary.
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 completely agree, however the CDK does not export the internal LinuxUserData
or WindowsUserData
classes. I originally just wanted to add the property to WindowsUserData
, but then of course a reference to UserData
trying to touch that property fails type checks. Without WindowsUserData
being exported it's not even possible to do instance.userData as WindowsUserData
So, we have two options.
- Accept that the property is on the base
UserData
class and only makes sense for one of the options; or - Export at least
WindowsUserData
so that users can type-cast to be able to setpersist
on it.
I went with (1), obviously. What would the CDK team prefer?
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.
@TheRealAmazonKendra Before the bot kills this PR. Any response to my question?
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.
@TheRealAmazonKendra Still waiting on your thoughts? Should I just add the integ test to the current PR's form, or switch to exporting WindowsUserData
and only having the new persist
method on WindowsUserData
instead of all UserData classes?
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 think the best option is actually to add this as an option in forWindows
. forLinux
has an option added it that is only specific to it so I think duplicating that experience makes sense in this context.
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 suggestion has been implemented.
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
Pull request has been modified.
Manually merged to reset the bot. I'm being a hypocrite here because I ask people to not do this, but I had missed your questions so the staleness is my fault, not yours. |
@Mergifyio update |
✅ Branch has been successfully updated |
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.
Putting this back in changes requested now that I've provided an answer.
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 fails with the following errors:
❌ Features must contain a change to an integration test file and the resulting snapshot.
PRs must pass status checks before we can provide a meaningful review.
To set the UserData for Windows instances to run on every instance start, rather than only the first startup, requires adding "<persist>true</persist>" to the end of the user data string. Currently, users must use an escape hatch to hack the userdata of windows instances to add this string. This PR makes it possible to add this text directly on the UserData without using an escape hatch.
2fe66d7
to
2a55cdb
Compare
Pull request has been modified.
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.
Looks good! I removed some some extra spacing in a couple places but this looks good to go.
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). |
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). |
To set the UserData for Windows instances to run on every instance start, rather than only the first startup, requires adding "true" to the end of the user data string. Currently, users must use an escape hatch to hack the userdata of
windows instances to add this string. This PR makes it possible to add this text directly on the UserData without using an escape hatch.
Implements: #21708
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license