Files
floci/docs/services
lex00 cebb011a00 fix(autoscaling): round-trip the dropped Auto Scaling group fields (#3494)
* fix(autoscaling): round-trip the dropped Auto Scaling group fields

CreateAutoScalingGroup and UpdateAutoScalingGroup accepted DesiredCapacityType,
CapacityRebalance, MaxInstanceLifetime and DefaultInstanceWarmup and threw them
away, so DescribeAutoScalingGroups never read them back. A mixed instances policy
launch template override that selected instance types by InstanceRequirements
instead of by name was dropped the same way, and because the override parser used
InstanceType's presence as its only "is there another override" signal, such an
override also truncated the whole Overrides list.

The four scalar members now travel into AutoScalingService as one AsgOptionalFields
record and are stored on AutoScalingGroup as boxed, uninitialised fields, so a group
that never set one omits it from the Describe response rather than reporting a
default. Update keeps its partial-update semantics: an absent member leaves the
stored value alone. DefaultInstanceWarmup honours the documented -1 removal
sentinel, MaxInstanceLifetime must be 0 or at least 86400, and DesiredCapacityType
is checked against units, vcpu and memory-mib.

LaunchTemplateOverrides.InstanceRequirements parses and echoes every member of the
botocore shape except BaselinePerformanceFactors, and an override that sets both
InstanceType and InstanceRequirements raises ValidationError as AWS does.

Verified against botocore autoscaling/2011-01-01/service-2.json from awscli 2.35.24.

* fix(autoscaling): enforce the attribute-based instance selection rules

Two rules that botocore states but does not encode as constraints were missing.

DesiredCapacityType is typed XmlStringMaxLen255 with no enum, and
CreateAutoScalingGroupType.members.DesiredCapacityType.documentation carries the
rule: "Amazon EC2 Auto Scaling supports DesiredCapacityType for attribute-based
instance type selection only." Floci accepted vcpu and memory-mib for a group
whose launch template names a fixed instance type. Both values now raise
ValidationError unless the mixed instances policy left in effect by the request
carries a launch template override with a non-empty InstanceRequirements. units
is the documented default and stays legal everywhere, and an absent member is
not validated.

The effective policy is the one the request supplies on create. On update it is
the policy the request supplies, the stored policy when the request names no
launch source, or none when the request switches the group to a launch
configuration or a plain launch template. The effective DesiredCapacityType is
likewise the request value or, when absent, the stored one, so an update cannot
strip attribute-based selection out from under a stored vcpu.

shapes.InstanceRequirements.required is ["VCpuCount", "MemoryMiB"] and the shape
documentation repeats it as "You must specify VCpuCount and MemoryMiB". An
override carrying InstanceRequirements without both ranges was stored and
returned 200; it now raises ValidationError. Both rules run on create and on
update.

createGroupCarryingEveryOptionalField is @Order(1) and seeds the group the later
ordered tests reuse, so its setup moved from a launch template naming t3.micro
to a mixed instances policy whose override sets VCpuCount and MemoryMiB. That
makes its DesiredCapacityType=vcpu legal without relaxing any assertion, and the
ordered updates that follow still see attribute-based selection in effect.
2026-09-12 18:37:36 -05:00
..
2026-05-10 11:53:31 -05:00
2026-08-21 00:09:04 -04:00
2026-09-02 11:39:10 -04:00