Skip to content

feat(connect): Windows --ssh + Windows beta guide rewrite & capability docs - #116

Merged
scttfrdmn merged 11 commits into
mainfrom
docs/windows-beta-guide-warm-ami
Jun 12, 2026
Merged

scttfrdmn merged 11 commits into
mainfrom
docs/windows-beta-guide-warm-ami

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

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> --ssh for Windows

The imported Windows AMI already runs OpenSSH and trusts spawn's launch key for Administrator (in buildWindowsUserData). This exposes it: --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 in PowerShell (no bash -c wrap). Factored the ssh exec into sshToInstance + a pure, unit-tested buildSSHCommandArgs shared 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

  • connect row now describes Linux SSH + Windows RDP / PowerShell-over-SSM / --ssh
  • added image (warm-AMI ISO import) and ami rows to the command table
  • Go Library example fixed: use the real launcher.Provision (recommended full-spore entry point) instead of the nonexistent client.LaunchInstance; note client.Launch as the lower-level path
  • corrected the Windows guide blurb (PowerShell-over-SSM/SSH, not "SSH-over-SSM"/SSO)

Windows 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 (not aws configure sso); SSM plugin optional; clean up both AMIs; v0.42.0 floor.

Readability (it explained things after using them):

  • intro no longer dumps the seed/Sysprep/warm-AMI mechanism — just plain time + cost expectations
  • "AMI" defined where it first appears; "why two images" explained at the build step where you first see them (was a separate section two steps later)
  • documented the new --ssh route; fixed "two ways in" → three
  • dropped fragile §-anchor links for plain "Step N" prose; fixed a URL typo and a stray code fence; renumbered 0–8

make check green; --ssh arg construction + flag presence covered by tests.

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

codecov Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.14815% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/connect.go 35.71% 27 Missing ⚠️
cmd/launch.go 91.66% 1 Missing ⚠️

📢 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)
@scttfrdmn scttfrdmn changed the title docs: update Windows beta guide for pre-warmed AMI build feat(connect): Windows --ssh + Windows beta guide rewrite & capability docs Jun 12, 2026
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.
@scttfrdmn
scttfrdmn merged commit 75453f9 into main Jun 12, 2026
3 checks passed
@scttfrdmn
scttfrdmn deleted the docs/windows-beta-guide-warm-ami branch June 12, 2026 16:05
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