Skip to content

fix(autoscaling): full Update field set, Describe filters + pagination, dup-name guard#1976

Merged
vieiralucas merged 1 commit into
mainfrom
wt-bughunt-b
Jun 26, 2026
Merged

fix(autoscaling): full Update field set, Describe filters + pagination, dup-name guard#1976
vieiralucas merged 1 commit into
mainfrom
wt-bughunt-b

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Cycle-4 bug-hunt Tier-1 cluster for the EC2 Auto Scaling service (findings 1.1, 1.9, 1.15, 4.5).

  • UpdateAutoScalingGroup now persists every mutable field DescribeAutoScalingGroups echoes back (DefaultCooldown, HealthCheckGracePeriod, VPCZoneIdentifier, AvailabilityZones, NewInstancesProtectedFromScaleIn, ServiceLinkedRoleARN, TargetGroupARNs, LaunchTemplate↔LaunchConfiguration swap). Previously only Min/Max/Desired/LC/HealthCheckType applied → Terraform changes to anything else returned 200 then silently dropped → perpetual diff / "provider produced inconsistent result after apply".
  • DescribeAutoScalingGroups / DescribeTags honor Filters (tag:/tag-key/tag-value/auto-scaling-group, and key/value/propagate-at-launch for tags). DescribeTags previously returned every group's tags → tag bleed across aws_autoscaling_group_tag resources.
  • All Describe* paginate: MaxRecords clamped to the AWS cap, NextToken emitted on truncation and resumed.
  • CreateAutoScalingGroup rejects a duplicate name with AlreadyExists instead of overwriting (which orphaned the prior group's launched instances).

Test plan

  • 5 new unit tests (full-field update round-trip, dup-name AlreadyExists, tag filter, DescribeTags scoping, pagination). cargo nextest run -p fakecloud-autoscaling 7 pass.
  • cargo clippy -p fakecloud-autoscaling --all-targets -- -D warnings clean.
  • CI tfacc autoscaling shard exercises the read shapes against the real Terraform provider.

Surface

Behavior fix within an existing service; no new public API/SDK surface.


Summary by cubic

Fixes ASG drift and read inconsistencies: updates now persist all mutable fields, Describe APIs support filters and pagination, and duplicate names are rejected. This removes Terraform perpetual diffs and prevents tag bleed.

  • Bug Fixes
    • UpdateAutoScalingGroup now saves all mutable fields (cooldowns, grace period, VPCZoneIdentifier, AZs, scale-in protection, ServiceLinkedRoleARN, TargetGroupARNs, and LaunchTemplate/LaunchConfiguration swap).
    • DescribeAutoScalingGroups and DescribeTags honor filters (tag:/tag-key/tag-value/auto-scaling-group; key/value/propagate-at-launch for tags) to stop tag bleed.
    • All Describe* calls paginate: MaxRecords clamped to AWS limits, NextToken returned and accepted.
    • CreateAutoScalingGroup rejects duplicate names with AlreadyExists instead of overwriting.

Written for commit e5741b0. Summary will update on new commits.

Review in cubic

…ters + pagination, duplicate-name guard

- UpdateAutoScalingGroup now persists every mutable field DescribeAutoScalingGroups
  echoes back (DefaultCooldown, HealthCheckGracePeriod, VPCZoneIdentifier,
  AvailabilityZones, NewInstancesProtectedFromScaleIn, ServiceLinkedRoleARN,
  TargetGroupARNs, LaunchTemplate/LaunchConfiguration swap). Previously only
  Min/Max/Desired/LC/HealthCheckType were applied, so Terraform changes to the
  rest were accepted with 200 then silently dropped -> perpetual diff /
  "provider produced inconsistent result after apply".
- DescribeAutoScalingGroups honors tag Filters (tag:<key>, tag-key, tag-value,
  auto-scaling-group); DescribeTags honors auto-scaling-group/key/value/
  propagate-at-launch Filters instead of returning every group's tags (which
  caused tag bleed across resources for aws_autoscaling_group_tag).
- All Describe* ops paginate: MaxRecords clamped to the AWS cap, NextToken
  emitted on truncation and resumed (offset token).
- CreateAutoScalingGroup rejects a duplicate name with AlreadyExists instead of
  overwriting (which orphaned the prior group's launched instances).

Adds unit tests for each.
@vieiralucas vieiralucas merged commit 03b6976 into main Jun 26, 2026
103 checks passed
@vieiralucas vieiralucas deleted the wt-bughunt-b branch June 26, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant