Repository navigation
fix(bootstrap): fetch spored from the regional S3 name; pre-flight counts an S3 interface endpoint (#1436) - #1466
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
force-pushed
the
fix/1436-regional-s3
branch
from
October 31, 2026 19:25
77e8a0c to
678918e
Compare
This was referenced Oct 31, 2026
Merged
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.
Fixes #1436
Every S3 name the bootstrap and spored's install paths use at boot is now the regional virtual-hosted name, so a
--no-public-ipinstance gets spored through an S3 interface endpoint with private DNS, not only through a gateway endpoint or NAT.URL inventory
pkg/launcher/bootstrap.gospawn-binaries-${SPAWN_BS_REGION:-us-east-1}.s3.amazonaws.com, thenspawn-binaries-us-east-1.s3.amazonaws.comspawn-binaries-${R}.s3.${R}.amazonaws.com, thenspawn-binaries-us-east-1.s3.us-east-1.amazonaws.comspawn-binaries-${REGION}.s3.amazonaws.com/ us-east-1 globalspawn upgrade-sporedSSM script,cmd/upgrade_spored.gocmd/app.go(x2)cmd/app.go(x4)aws s3 cp(no--region)aws s3 cp --region "$REGION"lambda/pipeline-orchestratorcmd/launch_config.gos3.amazonaws.com/ec2-downloads-windows/...amazon-ssm-${region}.s3.${region}.amazonaws.com/latest/...(region lookup moved ahead of it)pkg/sporedinstall/windows.goaws s3 cp --region <bucket's region>aws s3 cp --regiondeploy-sweep-orchestrator.sh,scripts/deploylambdas(operator side)Unchanged, not bootstrap: the task wrapper's and queue runner's
aws s3 cphave no--region. AWS CLI v2 takes the region from IMDS and sends us-east-1 to the regional name too (botocore'sAWS::S3::UseGlobalEndpointis hardcodedFalsein the v2 CLI; checked in awscli 2.39.3's bundled botocore). Plugins come from GitHub, not S3. The signing key is compiled in.Region/bucket mapping
The release publishes to 11
spawn-binaries-<region>buckets (SPAWN_BINARY_BUCKETS). Elsewhere the regional fetch finds no bucket and the us-east-1 fallback is the only source. That fallback is kept, now under its own regional name. It is cross-region, so no VPC endpoint can serve it. This PR addssporedinstall.PublishedRegions(), gated against the release workflow's list, and the pre-flight now refuses--no-public-ipin an unpublished region unless there is NAT (or--allow-missing-endpoints). Before, such an instance retired itself at boot.Pre-flight (
pkg/aws/private_network.go)s3now counts an interface endpoint with private DNS (GatewayOnlyremoved).DnsOptionsinto the newPrivateEndpoint.InboundResolverOnly.Published bootstrap body: CHANGES
Only the two bucket-URL lines differ. On this branch
spawn bootstrap-bodygives sha256a1b83f4b...where main gave925521a3.... The stub embeds the sha of the body its own build renders, anddeploy-sweep-orchestrator.sh/deploylambdascompare the published body with the one the tag renders. All of that stays self-consistent per release, so there is no pinned sha to update. Signed spored objects (.sha256,.sig) are untouched; only the hostname used to fetch them changes.Size
Gates
internal/s3hosts: finds every S3 URL (region variables resolved to the launch region; an unknown variable in a host fails), everyaws s3/s3apicall and every Windows source entry in a rendered script.pkg/launcherTestEveryBootstrapS3HostIsRegional: the stub, the inline bootstrap and the published body, for eu-west-2.cmdTestEveryGeneratedScriptS3HostIsRegional: boot bootstrap, SSM upgrade, 4 app user data, Windows bootstrap, and the Windows release install.cmdTestNoSourceUsesTheGlobalS3Name: a sweep of 605 non-test .go/.sh/.ps1/.yaml/.py source files.lambda/pipeline-orchestratorTestStageUserDataS3HostsAreRegional.TestPublishedRegionsAreTheReleaseBuckets.pkg/launcherboot sandbox now only rewrites the regional names, so a global URL 404s there.Each gate was watched failing against a compiling revert: the stub URL, body URL, body fallback, Windows SSM URL, app cert
--region, upgrade URL, pipeline URL, the deploylambdas URL (sweep), a dropped published region, the unpublished-region refusal, the inbound-only check, and the DnsOptions read.Not verified against AWS
Per the issue, the claim that an S3 interface endpoint's private DNS serves
*.s3.<region>.amazonaws.comand not*.s3.amazonaws.comcomes from the S3 PrivateLink docs, not a live test. So does theamazon-ssm-<region>bucket URL, which is in the SSM agent's Windows install docs. No AWS calls were made.Checks:
make check,make lint(0 issues in 10 modules),semgrep --config=auto(0 findings),make check-docsall clean;make api-snapshotcommitted.