Repository navigation
feat(windows): target-OS-aware launch + Windows connect (#55 Phase 1) - #82
Merged
Merged
Conversation
Makes spawn launch/connect first-class for Windows (SSM-first). Full in-instance spored on Windows remains out of scope (#77); the server-side reaper (#70) is the lifecycle backstop, so Windows launches require --ttl. Launch: - New LaunchConfig.TargetOS + spawn:os tag. resolveTargetOS picks the OS from an explicit --os flag, else auto-detects via aws.IsWindowsAMI. Wired into the single-instance and sweep paths. - windowsLifecycleGuard: Windows launch REQUIRES --ttl (no agent → no idle-timeout) and warns loudly that only the TTL deadline + reaper will stop it. - buildUserData branches to buildWindowsUserData for Windows: a minimal <powershell> EC2Launch block that enables OpenSSH and installs the spawn RSA public key into administrators_authorized_keys (no spored). encodeUserDataForOS uses plain base64 for Windows (EC2Launch doesn't gunzip) vs gzip+base64 for Linux. EFS/FSx Linux mount scripting is skipped on Windows. Connect: - spawn:os=windows routes to connectWindows: fetch + decrypt the Administrator password (RSA launch key via WaitForPasswordData + DecryptWindowsPassword), print it with RDP instructions (mstsc /v:<ip>, or SSM port-forward when no public IP), then open an SSM PowerShell session. `connect -- <cmd>` runs via the new aws.RunPowerShell (SSM AWS-RunPowerShellScript) helper. - Linux connect unchanged. Verified on real AWS (dev): Windows launch auto-detected OS + tag + RSA key + no-agent warning; connect decrypted the real Administrator password and opened SSM, and `connect -- "hostname; whoami"` returned output via SSM RunCommand; the no-TTL guard blocked a Windows launch with no instance created; AL2023 regression (spawn:os=linux, ed25519, connect works) intact. All instances terminated; zero leaks. Bump 0.37.2 → 0.37.3. Refs #55. Depends-on #77 for full lifecycle parity.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
Phase 1 of Windows support (#55): makes
spawn launch/connectfirst-class for Windows, SSM-first. Builds on the key-normalization work (RSA-on-Windows) and the Windows password helper already shipped in v0.37.1. Full in-instance spored on Windows is out of scope (#77) — the server-side reaper (#70) is the lifecycle backstop, so Windows launches require--ttl.Launch
LaunchConfig.TargetOS+ aspawn:ostag.resolveTargetOSpicks the OS from an explicit--osflag, else auto-detects viaaws.IsWindowsAMI. Wired into the single-instance and sweep paths.windowsLifecycleGuard: a Windows launch errors without--ttl(no agent → no idle-timeout) and warns loudly that only the TTL deadline + reaper will stop it.buildUserData→buildWindowsUserDatafor Windows: a minimal<powershell>EC2Launch block that enables OpenSSH and installs the spawn RSA public key intoadministrators_authorized_keys(no spored).encodeUserDataForOSuses plain base64 for Windows (EC2Launch doesn't gunzip) vs gzip+base64 for Linux. Linux EFS/FSx mount scripting is skipped on Windows.Connect
spawn:os=windows→connectWindows: fetch + decrypt the Administrator password (RSA launch key), print it with RDP instructions (mstsc /v:<ip>, or SSM port-forward when no public IP), then open an SSM PowerShell session.connect -- <cmd>runs via the newaws.RunPowerShell(SSMAWS-RunPowerShellScript) helper. Linux connect unchanged.Verified on real AWS (dev)
spawn:os=windows, RSA key registered, no-agent warning, TTL deadline set, boots + SSM online.spawn connect: decrypted the real Administrator password, printed RDP instructions, opened SSM PowerShell.spawn connect -- "hostname; whoami": returned output via SSM RunCommand.--ttlerrors with guidance, no instance created.spawn:os=linux, ed25519 key, connect works.Scope / safety
--ttlrequirement +spawn:ostag + reaper backstop prevent unbounded Windows instances.spawn:osis additive and the Windows connect branch only triggers on the tag.CLI-only (no spored/instance change) → bump 0.37.2 → 0.37.3.
Refs #55. Depends-on #77 for full lifecycle parity.