Repository navigation
feat(runners): reference launch template $Latest version in ASG - #1118
Merged
Merged
Conversation
ASG previously pinned the launch template Version at synth time; override to $Latest so new launches / scale-outs / instance refreshes always use the newest LT version whenever a change is deployed. Applies to all runner ASGs (mac/windows/linux). Note tradeoff: $Latest affects NEW instance launches; existing instances are replaced by the rolling UpdatePolicy on deploy, and a deploy that changes ONLY the launch template may not by itself force a rolling replacement (the ASG's Version string stays "$Latest") -- instances pick up latest when they next cycle/refresh. Signed-off-by: Arjun Yogidas <arjunry@amazon.com>
shashank-boyapally
approved these changes
Sep 9, 2026
smandhada16
approved these changes
Sep 9, 2026
coderbirju
added a commit
that referenced
this pull request
Sep 9, 2026
…SG (#1118)" (#1119) This reverts commit c711043. #1118 set the ASG LaunchTemplate.Version to the literal "$Latest", which CloudFormation rejects ("does not support using $Latest or $Default for LaunchTemplate version"), failing every ASG deploy in the pipeline (Beta stage). Revert to the CDK default (ASG references the launch template's LatestVersionNumber, a valid deploy-time version number that still tracks the newest version on each deploy). Signed-off-by: Arjun Yogidas <arjunry@amazon.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.
What
Add a CFN escape hatch in
lib/asg-runner-stack.tsso each runner ASG references its launch template by id at the$Latestversion, instead of the version number pinned at synth time.Why
The L2
AutoScalingGrouppinsVersiontoLatestVersionNumbercaptured at deploy time. By overriding to the literal$Latest, new instance launches, scale-outs, and instance refreshes always pick up the newest launch template version whenever a change is deployed (or a new LT version is created out-of-band), rather than a synth-time-pinned number. Applies to all runner ASGs (mac/windows/linux).Tradeoff
$Latestaffects new instance launches. Existing instances are replaced by the rollingUpdatePolicyon deploy. A deploy that changes only the launch template may not by itself force a rolling replacement (the ASG'sVersionstring stays"$Latest", so CloudFormation sees no ASG diff) — those instances pick up the latest version when they next cycle/refresh.Testing
npm run build(tsc) passes.npm test(jest): 12 suites / 18 tests pass.test/asg-runner-stack.test.tsverifying the ASG'sLaunchTemplatehasVersion: '$Latest', aLaunchTemplateId, and noLaunchTemplateName. No existing assertions were weakened (the prior suite did not assert an ASG LaunchTemplate version).npx cdk synthof a linux ASG stack rendersLaunchTemplate: { LaunchTemplateId: { Ref: ... }, Version: "$Latest" }.