Repository navigation
fix(spored): install AWS CLI before S3 download on Windows (#77) - #88
Merged
Merged
Conversation
Real-EC2 verification of v0.38.0 revealed the Windows bootstrap silently failed
to install spored: the stock Windows Server 2022 AMI has NO AWS CLI (unlike
AL2023, where install-spored.sh relies on the preinstalled aws), so the
`aws s3 cp` in buildWindowsUserData / install-spored.ps1 errored out and spored
was never downloaded. EC2Launch reported "script finished successfully" because
the install was in a try/catch with ErrorActionPreference=Continue.
Fix: install AWS CLI v2 (the official MSI) if aws.exe is absent, before the S3
download, and invoke it by full path ($ProgramFiles\Amazon\AWSCLIV2\aws.exe)
since the current session PATH won't include it yet. Applied to both the
launch user-data and install-spored.ps1.
Validated on real Windows 11: the MSI install command succeeds and yields a
working aws.exe (aws-cli/2.34.64); the generated user-data PowerShell parses
cleanly. (Also fixes a Go raw-string build break from backticks in the msiexec
args — switched to the -ArgumentList @('/i',$msi,'/qn') array form.)
Refs #77.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
scttfrdmn
added a commit
that referenced
this pull request
Jun 9, 2026
Patch release for the two fixes that make Windows spored actually install and self-manage on EC2 (found in v0.38.0 real-EC2 verification): - #88: install the AWS CLI before the S3 download (stock Windows AMI has none). - #89: attach SSM core to the spored instance role (Windows connect needs SSM). Verified end-to-end on real Windows EC2: boot → CLI install → spored download from S3 → Windows Service → reads config from tags → self-terminates at TTL.
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
Real-EC2 verification of v0.38.0 found the Windows bootstrap silently failed to install spored: the stock Windows Server 2022 AMI has no AWS CLI (unlike AL2023, where
install-spored.shrelies on the preinstalledaws), so theaws s3 cpinbuildWindowsUserData/install-spored.ps1errored and spored was never downloaded. EC2Launch reported "script finished successfully" because the install ran in a try/catch withErrorActionPreference=Continue.Fix
Install AWS CLI v2 (official MSI) if
aws.exeis absent, before the S3 download, and invoke it by full path ($ProgramFiles\Amazon\AWSCLIV2\aws.exe) since the session PATH won't include it yet. Applied to both the launch user-data andinstall-spored.ps1. Also fixes a Go raw-string build break (backticks in the msiexec args →-ArgumentList @('/i',$msi,'/qn')).Validated on real Windows 11
aws.exe(aws-cli/2.34.64).The end-to-end EC2 flow (boot → CLI install → spored download → service → monitor → self-terminate) is re-verified after this merges into the next release.
Refs #77.