In CloudFormation, I should be able to define per-instance-type WeightedCapacity overrides that allow me to take advantage of the recently announced instance-weighting feature. To align with the API, this should be specified in CloudFormation as a property of a LaunchTemplateOverride.
On Create or update, CloudFormation should perform an AutoScaling API call that includes the WeightedCapacity for each LaunchTemplateOverride specified in the AutoScalingGropup's MixedInstancesPolicy.LaunchTemplate.Overrides list.
N/A
Compute.
+1
We are currently using a combination of an ASG and an EC2 Spot Fleet to provide both on-demand and spot capacity for our ECS clusters. We'd like to simplify this by combining into one resource: either ASG, EC2 Spot Fleet or EC2 Fleet.
We had been leaning towards EC2 Spot Fleet because it supports weighting and this works well with ECS because you can set the weight for each instance type to be the number of vCPU and based on the vCPU requirements for each task definition, this helps ECS know how much capacity it needs to schedule tasks on different available instance types.
However when instance weighting for ASGs was announced we turned our attention back to ASGs. ASGs make more sense now as they appear to have better first-class support (e.g. ECS Capacity Providers only support ASGs, not EC2 Spot Fleet).
The lack of CloudFormation support for WeightedCapacity is the only thing holding us back from solving this problem with ASGs.
FWIW EC2 Fleet was only looked at briefly but we discarded it mainly because there is zero UX for it in the AWS Console and not everyone in our team is yet comfortable with command-line production monitoring exclusively.
In the meantime I guess the workaround is to run an after-deployment command with the CLI?
https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-weighting.html
Would be a bit messy because instances might get reshuffled right after deployment but the steady state should work as expected.
Seems like this is supported? The CloudFormation doc has been updated to include WeightedCapacity now.
Most helpful comment
+1
We are currently using a combination of an ASG and an EC2 Spot Fleet to provide both on-demand and spot capacity for our ECS clusters. We'd like to simplify this by combining into one resource: either ASG, EC2 Spot Fleet or EC2 Fleet.
We had been leaning towards EC2 Spot Fleet because it supports weighting and this works well with ECS because you can set the weight for each instance type to be the number of vCPU and based on the vCPU requirements for each task definition, this helps ECS know how much capacity it needs to schedule tasks on different available instance types.
However when instance weighting for ASGs was announced we turned our attention back to ASGs. ASGs make more sense now as they appear to have better first-class support (e.g. ECS Capacity Providers only support ASGs, not EC2 Spot Fleet).
The lack of CloudFormation support for WeightedCapacity is the only thing holding us back from solving this problem with ASGs.
FWIW EC2 Fleet was only looked at briefly but we discarded it mainly because there is zero UX for it in the AWS Console and not everyone in our team is yet comfortable with command-line production monitoring exclusively.