Skip to content

fix(runners): pin dedicated host family so mac-m4 (and mac1/c7i) hosts allocate correctly - #1120

Closed
coderbirju wants to merge 1 commit into
mainfrom
fix-mac-host-group-family-m4
Closed

coderbirju wants to merge 1 commit into
mainfrom
fix-mac-host-group-family-m4

Conversation

@coderbirju

Copy link
Copy Markdown
Contributor

Problem

arm macOS runners were moved to mac-m4.metal in #1117 (correct), but deploys fail instantly with:

The requested configuration is currently not supported. Please check the documentation for supported configurations. Launching EC2 instance failed.

This is not capacity (fails instantly in us-west-2b where mac-m4 is offered) and not the AMI (amzn-ec2-macos-15.7.9 sequoia/arm64 is M4-compatible; there is no separate M4 AMI).

Root cause

The dedicated Host Resource Group created in lib/asg-runner-stack.ts createHostResourceGroup used AWS::EC2::HostManagement with auto-allocate-host: true / auto-release-host: false but did not pin an instance family. With no family pin, the group auto-allocates/retains a stale family — the old mac2 hosts predating the mac-m4.metal move — so EC2 refuses to place a mac-m4.metal instance → "configuration not supported".

Fix

Pin the family the group is allowed to allocate/place hosts for, via the allowed-host-families AWS::EC2::HostManagement parameter, derived per platform/arch so it always matches the launch template's instanceType:

platform / arch instanceType pinned family
mac + arm mac-m4.metal mac-m4
mac + x86 mac1.metal mac1
windows c7i.2xlarge c7i

auto-allocate-host: true, auto-release-host: false, and the existing AWS::ResourceGroups::Generic config are unchanged. The instanceType logic (#1117), AMI lookup, #1113, and the #1119 $Latest revert are all untouched.

Parameter verification (the key risk)

The obvious guess instance-family is NOT a valid AWS::EC2::HostManagement parameter. The correct, documented parameter is allowed-host-families — an array of instance-family identifiers (e.g. c5, m5; here mac-m4, not the full mac-m4.metal). Verified against:

Both list allowed-host-families as a supported HostManagement parameter and give a worked example (["c5","m5"]). This is deploy-valid, unlike the instance-family guess.

Verification (real command output, not reasoning)

  • npm ci ✅ · npm run build (tsc) ✅
  • npm test18/18 pass, 12 suites ✅ — includes a new assertion test that the synthesized AWS::ResourceGroups::Group HostManagement config contains allowed-host-families = [mac-m4] (mac/arm), [mac1] (mac/x86), [c7i] (windows), while keeping the existing auto-release-host: false assertion intact.
  • Rendered-template dump (in-process app.synth()) confirmed the same values across every dedicated-host runner type.
  • CLI cdk synth of the pipeline stacks requires cross-account credentials for the Vpc.fromLookup context provider (tries to assume a lookup role in the target account), so the in-process synth via Template.fromStack is the authoritative local proof.

Operational follow-up (not in this PR)

Existing retained mac2 dedicated hosts in the current host groups must be released so the groups can allocate mac-m4 hosts (auto-release-host: false retained them). This is an operational step handled separately from this code change.

…s allocate correctly

arm macOS runners moved to mac-m4.metal in #1117, but deploys failed instantly with
"The requested configuration is currently not supported. ... Launching EC2 instance
failed." Root cause: the dedicated Host Resource Group in createHostResourceGroup used
AWS::EC2::HostManagement with auto-allocate-host=true / auto-release-host=false but did
NOT pin an instance family. With no family pin the group auto-allocates / retains a stale
family (the old mac2 hosts predating #1117), so EC2 refuses to place a mac-m4.metal
instance.

Fix: pin the family via the 'allowed-host-families' AWS::EC2::HostManagement parameter,
derived per platform/arch so it always matches the launch template instanceType:
mac+arm -> mac-m4, mac+x86 -> mac1, windows -> c7i. auto-allocate-host=true,
auto-release-host=false, and the existing Generic config are unchanged. instanceType logic
(#1117 mac-m4.metal) and the AMI lookup are untouched.

Parameter verified against AWS docs (do NOT guess): the hypothesized 'instance-family' is
NOT a valid HostManagement parameter. The correct, documented parameter is
'allowed-host-families' (array of family identifiers, e.g. c5/m5), per the AWS Resource
Groups User Guide, 'Supported configuration types and parameters' ->
AWS::EC2::HostManagement:
https://docs.aws.amazon.com/ARG/latest/userguide/about-slg-types.html
(also shown in the AWS::ResourceGroups::Group CloudFormation reference).

Verified locally: npm ci; npm run build (tsc) pass; npm test 18/18 pass, incl. a new
assertion test that the synthesized AWS::ResourceGroups::Group HostManagement config
contains allowed-host-families = [mac-m4] (mac/arm), [mac1] (mac/x86), [c7i] (windows).
Rendered-template dump confirmed the same values across every dedicated-host runner type.
CLI 'cdk synth' of the pipeline stacks needs cross-account creds for the Vpc.fromLookup
context provider, so the in-process synth (Template.fromStack) is the local proof.

Runtime follow-up (operational, NOT in this code change): existing RETAINED mac2 dedicated
hosts in the current host groups must be released so the groups can allocate mac-m4 hosts;
auto-release-host=false retained them. Handled separately by the operator.

Signed-off-by: Arjun Yogidas <arjunry@amazon.com>
@coderbirju
coderbirju requested a review from a team as a code owner September 9, 2026 23:24
@coderbirju coderbirju closed this Sep 10, 2026
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