Repository navigation
feat(connect): Windows --ssh + Windows beta guide rewrite & capability docs - #116
Merged
Merged
Conversation
The guide predated the warm-AMI feature (#102) and told beta testers to expect a slow ~30-min first boot on every launch, calling fast-boot "a future improvement" — which shipped. Brings it in line with current behavior: - §7 rewritten: the import pre-warms the AMI by default (launches a seed, lets it finish Sysprep, images it, auto-terminates the seed); warm launches are ~4 min, not ~30. The slow boot only happens on the base AMI / --no-warm. - §5: drop the `--wait` instruction (warm implies waiting); document the two AMI ids the import now prints (base + warm) and tell the user to launch the warm one. - §6: launch the warm AMI id. - §9: clean up BOTH AMIs (base + warm); add `spawn ami list`. - Version floor v0.40.0 → v0.42.0 (warm needs v0.41.0+; keyless SSM connect v0.42.0). - Set time/cost expectations up front: ~45–75 min build, the short-lived seed is billed but auto-terminated, two AMIs carry a small storage cost. - Fix a stale §2 cross-ref to the old §7 heading (made the NAT note self-contained).
A first-time beta tester doesn't need build-infra detail (NAT/S3 gateway) — the import auto-provisions networking. Reduce it to the actionable instruction (use us-east-1) with a plain reason; the full explanation stays in the infra README.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Add an upfront note that spawn currently leans on the AWS CLI (credentials + Session Manager connect paths), so a couple of steps are aws commands rather than spawn — set that expectation plainly instead of over-explaining each one. Trim the IAM-permissions laundry list to 'PowerUserAccess is simplest'.
spawn has always worked with the AWS CLI (aws sso login for credentials, the CLI's Session Manager for SSM). Drop the 'for now' framing — aws steps are expected by design, not a shortfall.
aws login (AWS CLI v2.34+) is the simpler sign-in: browser console login with auto-refreshing temp credentials, --profile support, and --remote for headless hosts. Replace the aws configure sso + aws sso login dance in §2, the quick-reference, and logout (aws logout). No SSO setup walkthrough needed.
The Session Manager plugin isn't needed for the happy path — plain 'spawn connect <name> --rdp' to the public IP uses no SSM. The plugin is only needed for the interactive SSM shell or '--rdp --via-ssm' tunnel. Move it from a hard prerequisite to an 'install if/when you use those paths' note.
On Windows there's no spawn SSH-user/key model — the spawn-driven non-RDP path is an interactive PowerShell session (and one-shot commands) over SSM, not SSH. Fix the intro, the §8B heading, and the readiness caveat to say so. (RDP to the public IP remains the no-SSM happy path.)
The imported Windows AMI already runs OpenSSH and trusts spawn's launch key for Administrator (buildWindowsUserData). Expose that: `spawn connect <name> --ssh` SSHes straight to the public IP as Administrator (PowerShell shell) — no SSM, no Session Manager plugin — mirroring the Linux default connect path. One-shot `--ssh -- '<cmd>'` runs the command in PowerShell (no bash -c wrap). Factor the ssh exec into sshToInstance + a pure buildSSHCommandArgs shared by the Linux and Windows paths. Errors clearly if there's no public IP or the launch key isn't on this machine.
README: - connect row now describes Linux SSH + Windows RDP/PowerShell-over-SSM/--ssh - add image (warm-AMI import) and ami rows to the command table - Go Library example: use the real API — launcher.Provision (the recommended full-spore entry point) instead of the nonexistent client.LaunchInstance; note client.Launch as the lower-level path - fix the Windows guide blurb (PowerShell-over-SSM/SSH, not "SSH-over-SSM"/SSO) Windows beta guide — readability/flow pass (was hard to read; explained things after using them): - intro no longer dumps the seed/Sysprep/warm-AMI mechanism; just sets plain time + cost expectations - define "AMI" where it first appears; explain "why two images" at the build step where you first see them (was a separate section 2 steps later) - document the new --ssh connect path (route C); fix "two ways in" -> three - drop fragile §-anchor links for plain "Step N" prose - fix the githu b.com URL typo and a stray trailing code fence - renumber 0-8 (folded the old standalone "why first boot is slow" section in)
Live smoke test of `spawn connect --ssh` found it couldn't connect: on the imported Windows AMI, sshd was Running and listening on 0.0.0.0:22 and the EC2 security group allowed the client IP, but Windows Firewall still blocked inbound 22. Root cause: the OpenSSH Server feature only creates a *Private*-profile allow rule, while an EC2 instance's network is classified *Public*. RDP worked (its rule covers all profiles); SSH didn't. buildWindowsUserData now adds an explicit New-NetFirewallRule for TCP 22 with -Profile Any after starting sshd (idempotent — guarded on rule name). Re-ran the smoke test on a fresh instance with this fix: port 22 opened, and both `spawn connect <name> --ssh -- '<cmd>'` (one-shot PowerShell) and the interactive `--ssh` session connected as Administrator. Added a regression assertion. Also fix the launch success hint: it said "(SSH-over-SSM)" — now lists the three real Windows connect paths (--rdp, --ssh, PowerShell-over-SSM).
Establish a curated changelog per project policy. Seeds Unreleased (the --ssh feature + Windows firewall fix on this branch) and the recent 0.40-0.42 releases; older history points to GitHub Releases. GoReleaser still auto-generates the GitHub release notes from commits — this is the human-curated companion.
This was referenced Jun 12, 2026
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.
Started as a refresh of the Windows beta guide; grew to include a real connect feature and a project-docs sync.
Feature:
spawn connect <name> --sshfor WindowsThe imported Windows AMI already runs OpenSSH and trusts spawn's launch key for Administrator (in
buildWindowsUserData). This exposes it:--sshSSHes straight to the public IP as Administrator (PowerShell shell) — no SSM, no Session Manager plugin — mirroring the Linux default connect path. One-shot--ssh -- '<cmd>'runs in PowerShell (nobash -cwrap). Factored the ssh exec intosshToInstance+ a pure, unit-testedbuildSSHCommandArgsshared by the Linux and Windows paths. Errors clearly when there's no public IP or the launch key isn't local.README — reflect current capabilities
connectrow now describes Linux SSH + Windows RDP / PowerShell-over-SSM /--sshimage(warm-AMI ISO import) andamirows to the command tablelauncher.Provision(recommended full-spore entry point) instead of the nonexistentclient.LaunchInstance; noteclient.Launchas the lower-level pathWindows beta guide — accuracy + readability
Accuracy (predated the warm-AMI feature #98/#102): pre-warmed build is default; two AMI ids; launch the warm one;
aws login(notaws configure sso); SSM plugin optional; clean up both AMIs; v0.42.0 floor.Readability (it explained things after using them):
--sshroute; fixed "two ways in" → three§-anchor links for plain "Step N" prose; fixed a URL typo and a stray code fence; renumbered 0–8make checkgreen;--ssharg construction + flag presence covered by tests.