-
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
AutoScaling: Support a external LaunchConfiguration and LaunchTemplate to AutoScalingGroup #1403
Comments
Closing this issue since there hasn't been activity on it or on the related PR in a while. Feel free to reopen. |
I think the FR is still valid. |
I would like to use a launch template rather than machine image. |
The current AutoScalingGroup L2 construct only supports Spot Fleet. We have a customer who needs a generic EC2 Fleet (i.e. Launch Template) that is managed by an ASG; this will allow them to run certain components primarily on Spot, but fall-back to on-demand when there is no Spot capacity available. |
Previous comments of mine on this topic: So, this PR brings to the forefront an interesting dilemma: how should we do the LaunchTemplate/Configuration going forward? We are currently in the situation that the launch properties are inlined into the props of the AutoScalingGroup. This is great for usability, but not so much for future extension, and it also doesn't allow using an existing or a custom LaunchTemplate. An alternative is to ONLY take a Another alternative is to BOTH accept all configuration options (or at least the most common ones) as well as a Another another alternative is to use an enum-like pattern, where we can do something like: launchInfo: LaunchInfo.simple({
instanceType: new InstanceType(...)
}),
launchInfo: LaunchInfo.withMixedInstancePolicy({ ... }),
launchInfo: LaunchInfo.fromLaunchTemplate(myExistingLaunchTemplate), (Name Unsure if the "enum-like" pattern isn't going to end up biting itself too. We could also use the enum-like pattern for different subsets of launch properties, one enum-like for instance types, another enum-like for userdata, etc. Q: Can existing AutoScalingGroups using a LaunchConfig be transparently upgraded to using a LaunchTemplate? Or will this result in an error? (I suspect the latter) Don't really know how to proceed, and soliciting other people's opinions as well. I'd like it if someone could make a table of LaunchConfig/LaunchTemplate features, show which ones apply to which, and which ones we already support in our current
|
Here's what I think the right approach is: We'd still want to keep (some of) the parameters that we have on the LaunchTemplate on the We now have the option to combine them into the same props. That would look like this: class AutoScalingGroupProps {
/**
* Mutually exclusive with launchTemplate
*/
readonly instanceType?: ec2.InstanceType;
readonly userData: ...;
readonly associatePublicIpAddress: ...;
readonly blockDeviceMappings: ...;
readonly ...;
/**
* Mutually exclusive with instanceType, userData, associatePublicIpAddress, blockDeviceMappings, ...
*/
readonly launchTemplate?: ec2.ILaunchTemplate;
} In a just world, we would have had
In the world we have, why don't we do the following:
Thoughts? |
For what it's worth, I agree. I was looking at this last night. The LaunchTemplate is used in more than just the AutoScalingGroup; it's also used, in the same way, in the EC2::Instance, and EC2::Fleet. In all cases, the reference in those Cfn resources looks like: {
"LaunchTemplateId" : string,
"LaunchTemplateName" : string,
"Version" : string
} where the Seems to me that it makes the most sense to create a LaunchTemplate L2, and pass the This lets you:
It seems like a clear win, to me, over trying to work with a hodge-podge of properties in the Instance, Fleet, and ASG L2's to materialize a LaunchTemplate behind the scenes. The user experience doesn't feel right down that path, especially when you factor in that the three constructs likely will not be kept at the same level of LaunchTemplate support. |
Resolved by #19066 |
|
I want to use custom LaunchConfiguration in AutoScalingGroup library.
For example, when to use a spot instance.
The text was updated successfully, but these errors were encountered: