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

(autoscaling): applyCloudFormationInit on each launchTemplateOverrides of mixedInstancesPolicy #27030

Closed
2 tasks
BDeus opened this issue Sep 6, 2023 · 2 comments
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature-request A feature should be added or improved. p1 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@BDeus
Copy link
Contributor

BDeus commented Sep 6, 2023

Describe the feature

In the Construct autoscaling when setting a CloudFormationInit, the UserData is apply on the LaunchTemplate attach to the ASG.

public applyCloudFormationInit(init: ec2.CloudFormationInit, options: ApplyCloudFormationInitOptions = {}) {
if (!this.autoScalingGroup.cfnOptions.creationPolicy?.resourceSignal) {
throw new Error('When applying CloudFormationInit, you must also configure signals by supplying \'signals\' at instantiation time.');
}
init.attach(this.autoScalingGroup, {
platform: this.osType,
instanceRole: this.role,
userData: this.userData,

In case of usage of a MixedInstancesPolicy with LaunchTemplateOverrides, the overrides do not inherit from the UserData of the CloudFormationInit

Use Case

In case on multiple LaunchTemplate (ARM and x86 as example) the second one does apply the CloudFormationInit?
I do not know how to add the UserData on LaunchTemplateOverrides.

Proposed Solution

add the ability to copy the UserData of the main LaunchTemplate to every LaunchTemplates overrides on a MixedInstancesPolicy

Other Information

If anyone as a workaround solution, i'll be grateful

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.93.0

Environment details (OS name and version, etc.)

linux

@BDeus BDeus added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 6, 2023
@github-actions github-actions bot added the @aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling label Sep 6, 2023
@indrora indrora added p1 feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs and removed needs-triage This issue or PR still needs to be triaged. labels Sep 8, 2023
@indrora
Copy link
Contributor

indrora commented Sep 8, 2023

While I believe this is the case, what would this look like in CloudFormation? Could you build this in CloudFormation?

@indrora indrora added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 8, 2023
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature-request A feature should be added or improved. p1 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants