-
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
ec2: userData in launchTemplate is not created automatically even when machineImege is provided #23592
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Comments
tmokmss
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Jan 6, 2023
github-actions
bot
added
the
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
label
Jan 6, 2023
Merged
4 tasks
peterwoodworth
added
p2
effort/small
Small work item – less than a day of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jan 7, 2023
Thanks for the quick PR on this! |
mergify bot
pushed a commit
that referenced
this issue
Feb 27, 2023
…chineImege is provided (#23593) closes #23592 Reading through the discussion in PR #12385, which introduced the original code, I could not find any reason not to create userData when machineImage is provided. They also agreed with the design [here](#12385 (comment)), but it seems it accidentally became out of scope at the time. This change should not be considered as a breaking change because we are just adding empty userData to launchTemplates whose userData is not specified explicitly, and it will not have any effect on the existing behavior. * Users who already sets a userData explicitly: * will not see any change to their synthesized template, as this PR only modifies userData when it is not set explicitly. * Users who is not using userData: * will see a userData is added to their template. But the userData is empty and does nothing. It should not have any effect on the previous behavior. ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [X] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [X] Did you use `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*
|
westhouseK
pushed a commit
to westhouseK/aws-cdk
that referenced
this issue
Feb 28, 2023
…chineImege is provided (aws#23593) closes aws#23592 Reading through the discussion in PR aws#12385, which introduced the original code, I could not find any reason not to create userData when machineImage is provided. They also agreed with the design [here](aws#12385 (comment)), but it seems it accidentally became out of scope at the time. This change should not be considered as a breaking change because we are just adding empty userData to launchTemplates whose userData is not specified explicitly, and it will not have any effect on the existing behavior. * Users who already sets a userData explicitly: * will not see any change to their synthesized template, as this PR only modifies userData when it is not set explicitly. * Users who is not using userData: * will see a userData is added to their template. But the userData is empty and does nothing. It should not have any effect on the previous behavior. ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [X] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [X] Did you use `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*
beck3905
pushed a commit
to beck3905/aws-cdk
that referenced
this issue
Feb 28, 2023
…chineImege is provided (aws#23593) closes aws#23592 Reading through the discussion in PR aws#12385, which introduced the original code, I could not find any reason not to create userData when machineImage is provided. They also agreed with the design [here](aws#12385 (comment)), but it seems it accidentally became out of scope at the time. This change should not be considered as a breaking change because we are just adding empty userData to launchTemplates whose userData is not specified explicitly, and it will not have any effect on the existing behavior. * Users who already sets a userData explicitly: * will not see any change to their synthesized template, as this PR only modifies userData when it is not set explicitly. * Users who is not using userData: * will see a userData is added to their template. But the userData is empty and does nothing. It should not have any effect on the previous behavior. ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [X] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [X] Did you use `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*
homakk
pushed a commit
to homakk/aws-cdk
that referenced
this issue
Mar 28, 2023
…chineImege is provided (aws#23593) closes aws#23592 Reading through the discussion in PR aws#12385, which introduced the original code, I could not find any reason not to create userData when machineImage is provided. They also agreed with the design [here](aws#12385 (comment)), but it seems it accidentally became out of scope at the time. This change should not be considered as a breaking change because we are just adding empty userData to launchTemplates whose userData is not specified explicitly, and it will not have any effect on the existing behavior. * Users who already sets a userData explicitly: * will not see any change to their synthesized template, as this PR only modifies userData when it is not set explicitly. * Users who is not using userData: * will see a userData is added to their template. But the userData is empty and does nothing. It should not have any effect on the previous behavior. ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [X] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [X] Did you use `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*
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
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
Reading this doc,
userData
is expected to be automatically created whenmachineImage
is provided.However, it is not working as expected;
userData
is not automatically created at all. See reproduction steps for the actual code.Expected Behavior
userData
is automatically created whenmachineImage
is provided.Current Behavior
userData
is not created even whenmachineImage
is provided.Reproduction Steps
Synthesize the below stack:
and we get the following error:
Possible Solution
Current implementation is here. We need to add code for creating userData depending on machineImage.
I guess we can follow the below implementation in
ec2.Instance
:aws-cdk/packages/@aws-cdk/aws-ec2/lib/instance.ts
Lines 349 to 351 in f178c98
Additional Information/Context
Adding this feature will not be a breaking change because we are just adding empty userData to launchTemplates whose userData was not specified explicitly, and it will not have any effect on the existing behavior.
CDK CLI Version
2.59.0
Framework Version
2.59.0
Node.js Version
v16.18.1
OS
macOS
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: