feat(sync): tear down de-configured autoscaling instead of orphaning it#85
Open
stevethomas wants to merge 1 commit into
Open
feat(sync): tear down de-configured autoscaling instead of orphaning it#85stevethomas wants to merge 1 commit into
stevethomas wants to merge 1 commit into
Conversation
Autoscaling is now fully declarative — sync converges live state down to the manifest, so changing config tidies up the scalable target, policies and their AWS-generated alarms rather than leaving them live and invisible to `yolo audit`. - Remove `request-count-per-target` → the request-count policy is pruned (cascading its scale-out/scale-in alarms); the CPU policy stays. - Remove the whole `autoscaling` block → the scalable target is deregistered, cascading every policy and alarm. The service reverts to a fixed task count frozen at its current live count (no tasks dropped). The two autoscaling steps are now wired whenever the web task exists (not only when autoscaling is on) so the teardown path can run after the block is removed; both no-op when it was never enabled. Pruning diffs live policies against the manifest's intent, never the resolvable-now set, so a merely-deferred request-count policy (ALB/TG not yet resolvable) is never mistaken for one that was removed. Adds DELETED / WOULD_DELETE to StepResult so teardown reports as a delete rather than a SYNCED — completing the create/update/delete reconcile verbs and making the destructive action legible at the plan -> confirm gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I made a thing! 🥳
Great! Now please answer the following questions to help out your assigned reviewer:
What problems are you solving?
Autoscaling config was additive only — sync created and updated policies/targets but never removed ones that fell out of the manifest. So changing config left orphans that kept running live and were invisible to
yolo audit(App Auto Scaling resources aren't taggable):request-count-per-targetleft the request-count policy + its 2 alarms live and still scaling.autoscalingblock orphaned the scalable target, both policies, and all alarms (the steps weren't even wired when the block was absent).This makes autoscaling declarative — sync converges live state down to the manifest:
request-count-per-target→ the request-count policy is pruned, cascading its scale-out/scale-in alarms; the CPU policy stays.autoscalingblock → the scalable target is deregistered, cascading every policy and alarm.DELETED/WOULD_DELETEtoStepResultso teardown reports as a delete (the third reconcile verb) rather than a misleadingSYNCED, and the destructive action is legible at the plan → confirm gate.Is there anything the reviewer needs to know to deploy this?
yolo scaleif you no longer need the capacity. The plan surfaces it asweb autoscaling: present → absent(WOULD_DELETE) before you confirm.DescribeScalableTargetsread per sync; both steps no-op when autoscaling was never enabled.🤖 Generated with Claude Code