Light, fluffy, and always free - The AWS Local Emulator alternative
test(autoscaling): preserve AWS subnet whitespace normalization (#5509)
Andre Kurait017901a030e6
diff --git a/compatibility-tests/sdk-test-python/tests/test_autoscaling_subnet_whitespace.py b/compatibility-tests/sdk-test-python/tests/test_autoscaling_subnet_whitespace.pynew file mode 100644index 0000000000..172c538b7a--- /dev/null+++ b/compatibility-tests/sdk-test-python/tests/test_autoscaling_subnet_whitespace.py@@ -0,0 +1,66 @@+"""CreateAutoScalingGroup delimiter parity observed on AWS, 2026-10-12."""++import uuid+from contextlib import ExitStack, closing++import boto3+++def test_subnet_comma_space_is_normalized(ec2_client, aws_config, client_config):+ name = "subnet-whitespace-" + uuid.uuid4().hex[:12]+ region = aws_config["region_name"]+ zones = [region + "a", region + "b"]+ with closing(boto3.client("autoscaling", config=client_config, **aws_config)) as autoscaling:+ with ExitStack() as cleanup:+ vpc = ec2_client.create_vpc(CidrBlock="10.98.0.0/16")["Vpc"]["VpcId"]+ cleanup.callback(ec2_client.delete_vpc, VpcId=vpc)+ subnets = []+ for index, zone in enumerate(zones):+ subnet = ec2_client.create_subnet(+ VpcId=vpc,+ CidrBlock=f"10.98.{index}.0/24",+ AvailabilityZone=zone,+ )["Subnet"]["SubnetId"]+ cleanup.callback(ec2_client.delete_subnet, SubnetId=subnet)+ subnets.append(subnet)+ image = ec2_client.register_image(+ Name=name, Architecture="x86_64", RootDeviceName="/dev/sda1"+ )["ImageId"]+ cleanup.callback(ec2_client.deregister_image, ImageId=image)+ template = ec2_client.create_launch_template(+ LaunchTemplateName=name,+ LaunchTemplateData={"ImageId": image, "InstanceType": "t3.micro"},+ )["LaunchTemplate"]["LaunchTemplateId"]+ cleanup.callback(ec2_client.delete_launch_template, LaunchTemplateId=template)++ configurations = []+ for suffix, separator in [("space", ", "), ("no-space", ",")]:+ group_name = name + "-" + suffix+ autoscaling.create_auto_scaling_group(+ AutoScalingGroupName=group_name,+ MinSize=0,+ MaxSize=0,+ DesiredCapacity=0,+ AvailabilityZones=zones,+ LaunchTemplate={"LaunchTemplateId": template, "Version": "1"},+ VPCZoneIdentifier=separator.join(subnets),+ )+ cleanup.callback(+ autoscaling.delete_auto_scaling_group,+ AutoScalingGroupName=group_name,+ ForceDelete=True,+ )+ groups = autoscaling.describe_auto_scaling_groups(+ AutoScalingGroupNames=[group_name]+ )["AutoScalingGroups"]+ assert len(groups) == 1+ group = groups[0]+ assert group["VPCZoneIdentifier"] == ",".join(subnets)+ assert set(group["AvailabilityZones"]) == set(zones)+ assert group["Instances"] == []+ assert group["MinSize"] == group["MaxSize"] == group["DesiredCapacity"] == 0+ configurations.append({+ key: value for key, value in group.items()+ if key not in {"AutoScalingGroupName", "AutoScalingGroupARN", "CreatedTime"}+ })+ assert configurations[0] == configurations[1]diff --git a/docs/services/autoscaling.md b/docs/services/autoscaling.mdindex beb2f20077..e28c519aee 100644--- a/docs/services/autoscaling.md+++ b/docs/services/autoscaling.md@@ -29,6 +29,14 @@ Floci implements the EC2 Auto Scaling API — stored-state management for launch| `UpdateAutoScalingGroup` | Updates capacity bounds, cooldown, launch source, AZs || `DeleteAutoScalingGroup` | `ForceDelete=true` terminates all instances before deletion |+`CreateAutoScalingGroup` accepts both `subnet-a,subnet-b` and+`subnet-a, subnet-b` in `VPCZoneIdentifier`. `DescribeAutoScalingGroups` returns the+comma-only form. This matches a live AWS comparison in `us-east-1` on October 12,+2026 at 17:30 UTC: two subnets, matching Availability Zones, one launch template+and zero capacity. Both groups had identical configuration except for name, ARN+and creation time. The SDK regression is+`compatibility-tests/sdk-test-python/tests/test_autoscaling_subnet_whitespace.py`.+### Instance Management| Operation | Notes |