EC2 Auto Scaling
Amazon EC2 Auto Scaling — Auto Scaling Groups, Launch Configurations, desired-capacity reconciliation, and scaling activities. Query protocol.
EC2 Auto Scaling (the autoscaling service) manages EC2 fleets — distinct from Application Auto Scaling (the application-autoscaling service), which scales DynamoDB / ECS / etc. targets.
The wedge: against every other free local emulator an Auto Scaling Group scales to a mock instance (LocalStack #8367 "ASG launches a mock EC2 instead of a Docker instance"; MiniStack's ASG is a Terraform-timeout stub). fakecloud runs EC2 instances as real containers, so an ASG reconciled to its desired capacity launches real instances.
Supported today
- Launch Configurations —
CreateLaunchConfiguration,DescribeLaunchConfigurations,DeleteLaunchConfiguration, includingBlockDeviceMappingsandMetadataOptions. - Auto Scaling Groups —
CreateAutoScalingGroup,DescribeAutoScalingGroups,UpdateAutoScalingGroup,DeleteAutoScalingGroup(rejects delete with instances unlessForceDelete). The launch source is exactly one of a Launch Configuration, an EC2 Launch Template, anInstanceId(a launch configuration named after the group is derived from the instance: AMI, type, key pair, security groups, user data, IAM instance profile, volumes, and its subnet or AZ when the group names none), or aMixedInstancesPolicy(launch template +OverrideswithInstanceType,WeightedCapacityand per-overrideLaunchTemplateSpecification, plus itsInstancesDistribution). A launch configuration that does not exist, or a launch template / version that does not resolve, is rejected withValidationError; a resolved template is reported with both its id and name, and$Defaultwhen no version was given. - Capacity —
SetDesiredCapacityand theDesiredCapacityon create/update reconcile the group's instance set, launching real container-backed EC2 instances or terminating them on scale-in, and recording aSuccessfulscaling activity for each. Every instance launches through EC2RunInstances, so it gets exactly what a direct launch would: a launch template's resolved version (image, type, key pair, security groups, network interfaces, user data, IAM instance profile, block-device mappings as real EBS volumes, tags, metadata options, ...), or a launch configuration's equivalent (BlockDeviceMappings,IamInstanceProfile,UserData,SecurityGroups,KeyName, monitoring, tenancy, metadata options). Encrypted volumes get the region'saws/ebskey. A mixed-instances group follows itsInstancesDistribution: on-demand up toOnDemandBaseCapacity, thenOnDemandPercentageAboveBaseCapacitypercent on-demand and the rest Spot (launched withInstanceMarketOptionsSpot, atSpotMaxPricewhen set). On-demand launches take the highest-priority override (lowest-pricefalls back to override order, as fakecloud has no instance pricing data); Spot launches spread across the firstSpotInstancePoolsoverrides forlowest-price, or across all of them for the capacity strategies.WeightedCapacitycounts toward the desired capacity, and scale-in removes the heaviest instances that keep the group at or above it. A launch configuration'sSpotPricelaunches Spot instances. Instances are spread across theVPCZoneIdentifiersubnets (or the group's availability zones), carry theaws:autoscaling:groupNametag and the group'sPropagateAtLaunchtags (which win over same-key launch-template tags), and report theirInstanceType,LaunchTemplate(with the concrete version) andWeightedCapacity. A launch that cannot resolve its template records aFailedscaling activity instead of a phantom instance. The launched instances show up in EC2DescribeInstancesandDescribeVolumes, unlike every free rival, whose ASG scales to a mock instance (LocalStack #8367). - Activities —
DescribeScalingActivitiesreturns the launch/terminate activities (this is the op Terraform'saws_autoscaling_groupcreate blocks on, and the one MiniStack lacks — #331). - Instances —
DescribeAutoScalingInstancesreports each group's instances withLifecycleState/HealthStatus. - Tags —
CreateOrUpdateTags,DeleteTags,DescribeTags(withPropagateAtLaunch).
Protocol
AWS Query protocol (form-encoded request, <ActionResponse>...<ResponseMetadata> XML response), endpoint autoscaling.<region>.amazonaws.com.
Roadmap
- Scaling policies (target-tracking / step), lifecycle hooks, instance refresh, and conformance-harness coverage.