Skip to content

fix(aws/autoscaling): converge ASG and capacity provider with ECS managed scaling - #2009

Merged
sam-goodwin merged 4 commits into
alchemy-run:mainfrom
Makisuo:fix/aws-autoscaling-capacity-convergence
Oct 6, 2026
Merged

sam-goodwin merged 4 commits into
alchemy-run:mainfrom
Makisuo:fix/aws-autoscaling-capacity-convergence

Conversation

@Makisuo

@Makisuo Makisuo commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes three convergence issues when an AutoScalingGroup backs an ECS CapacityProvider.

  • Redeploy reset desired capacity. updateAutoScalingGroup always sent desiredCapacity ?? minSize, undoing whatever ECS managed scaling had set. An omitted desiredCapacity now leaves the live value alone on update; create still defaults to minSize.
  • Fresh instance profiles failed ASG creation. A launch template referencing a just-created instance profile is rejected with Invalid IAM Instance Profile until the profile propagates. createAutoScalingGroup and updateAutoScalingGroup now retry it with backoff, typed in distilled as InvalidIamInstanceProfile (feat(aws/auto-scaling): type InvalidIamInstanceProfile on create/updateAutoScalingGroup distilled#764).
  • Deleted capacity providers were treated as live. A deleted provider stays describable as INACTIVE for a while, so read / reconcile tried to update it instead of creating a new one. describe now skips INACTIVE providers, matching how Service already filters them.

Live tests in the existing suites: AutoScalingGroup.test.ts creates a group whose launch template names a fresh instance profile, raises desired capacity externally (Launch suspended, no instance starts), and redeploys; CapacityProvider.test.ts removes a provider and adds it back. On main they fail with InvalidIamInstanceProfile, a desired capacity reset to minSize, and OwnedBySomeoneElse for the INACTIVE leftover.

@alchemy-version-bot

alchemy-version-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

alchemy

pnpm install https://pkg.alchemy.run/alchemy/pr:2009:6756b37
@alchemy.run (6)
pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@alchemy.run/floci/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:2009:6756b37
@distilled.cloud (16)
pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/axiom/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/doppler/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/infisical/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/stripe/pr:2009:6756b37
pnpm install https://pkg.alchemy.run/@distilled.cloud/zerossl/pr:2009:6756b37

Published Oct 6, 2026, 4:35 PM UTC. Expires Oct 13, 2026, 4:35 PM UTC, extended while this pull request is open.

… tests

Retry the distilled InvalidIamInstanceProfile tag (alchemy-run/distilled#764)
on create and update instead of matching ValidationError messages, and
catch AlreadyExistsFault by tag.

Live tests in the existing suites:
- AutoScalingGroup: a fresh instance profile + omitted desiredCapacity;
  an external scaler raises desired (Launch suspended) and a redeploy
  keeps it. On main the create fails with InvalidIamInstanceProfile and
  the redeploy resets desired to minSize.
- CapacityProvider: remove and re-add a provider; on main the INACTIVE
  leftover is read as foreign and the deploy fails with OwnedBySomeoneElse.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	submodules/distilled
@sam-goodwin
sam-goodwin merged commit 2f11a19 into alchemy-run:main Oct 6, 2026
5 checks passed
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.

2 participants