Repository navigation
feat(launch): --bootstrap-egress proxy on detached parameter sweeps; orchestrator ensures the proxy (#1515 PR B) - #1533
Conversation
…t the orchestrator the proxy's actions (#1515)
Cross-account policy: real PutRolePolicy + simulation (spore-host-dev 435415984226, throwaway role)I rendered the policy from I put it on a throwaway role,
Owner decision (2026-11-05): release, then test. This merges into v0.160.0. After the CI deploy, the live plan runs in spore-host-dev:
If anything regresses, roll back by dispatching the v0.159.0 deploy. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Live test: PASS (spore-host-dev 435415984226, us-east-1, released v0.160.0 CLI and orchestrator, no-NAT VPC)
Teardown: All instances are terminated. |
Refs #1515
Sweep support, part B:
--bootstrap-egress proxyon detached parameter sweeps. When a proxy has gone, the sweep orchestrator creates a new one, following the 2026-11-05 owner decision.Submit (CLI)
refuseDetachedSweepEgressProxyand its 3 call sites are deleted, andvalidateBootstrapEgressFlagsloses itsdetachedSweepargument.detachedSettingsGuardnow refuses only a config that names its ownEgressProxyAddr.seedDetachedBootstrapruns each member's subnet check, as it did before.privateNetOfnow returns thePrivateCheck. A member whose check relies on the proxy gets three things:deploy.PendingAddr, which is192.0.2.1:3128(TEST-NET-1);spawn_egress_proxy_vpc, a new reserved key that is indetachedParamKeys;ensureDetachedInstanceProfile.ensureDetachedEgressProxiesruns for each (region, VPC):findOrCreateEgressProxy, the foreground path, which also sets upspored-instance-profile;PendingAddrto the proxy's address and adding the clients group throughMemberGroups, afterCheckMemberEgress;SweepTargetfor the record.normalizeDetachedUserDatafails closed if one is still there.--no-public-ipanyway.Record
SweepRecord.EgressProxies []sweepproxy.Target(egress_proxies) is in a new stdlib-only package,pkg/egressproxy/sweepproxy, soscheduler-handlerdoes not link the proxy's launch code. Putting it indeployadded 97 go.mod lines to that Lambda. Each target holds:CreatingSince,Created, errors andFailReason.Orchestrator ensure phase (
deploy.EnsureSweep,lambda/sweep-orchestrator/egress_proxy.go)WaitReadyis split intoCheckReady(one look) and the loop.FindOrCreateandEnsureSweepshareEnsureGroups,Find/Evaluate,Create/RunInputandCheckReady. No logic is duplicated.FailReason. No AWS calls.CheckReady.ReadyTimeout) afterCreatingSince: the proxy is terminated, the target is failed, and the reason is recorded.EnsureGroupsre-creates deleted groups and reconciles their rules.Findevaluates proxies against the recorded version.CheckReadypasses.Createlaunches a new proxy from the recorded inputs, the target becomescreating, and its members are held.RebindUserData) and so are its groups (RebindGroups), and its egress to the new proxy IP is checked.Create's existing instance-profile retry.creating. It is idempotent: live instances only.IAM:
SpawnSweepCrossAccountRole(scripts/setup-sweep-cross-account-role.sh)RunInstances,CreateTags,TerminateInstancesand the Describes were already granted unconditioned, and the PassRole ofspored-instance-rolealready existed.TestSweepCrossAccountRoleGrantsTheEgressProxyholds the six new statements exactly. It also checks that no Resource uses a policy variable (Every spawn launch fails on v0.129.0/v0.130.0: spored role policy rejected (MalformedPolicyDocument) #1069) and that every condition key belongs to its action's service.TestEveryPrincipalCallIsGrantednow claimsssmfor the member-account context. Without the new statements it fails on the orchestrator'sssm:SendCommand/GetCommandInvocationand the SG actions.SpawnSweepOrchestratorRole: nothing new.Deploy checklist
lambda/sweep-orchestrator: code-only.lambda/scheduler-handler: code-only, because it compiles pkg/sweep's record. Its behaviour doesn't change.scripts/setup-sweep-cross-account-role.sh: manual. Re-run it per member account, after a real PutRolePolicy check on a throwaway role in spore-host-dev. Until then, a re-creation is denied and that VPC's members fail with the reason. Sweeps whose CLI-made proxy stays reusable are unaffected.Checks
make checkpasses.go test ./...passes, run with the AWS env stripped. That covers root,lambda/sweep-orchestrator,scriptsand all nested modules (all tidy).semgrep --config=auto --erroris clean.gen-docs,api-snapshotandcli-iam-actionswere run.docs-gen/launch.mdwas regenerated for the new--bootstrap-egresshelp.No AWS was touched.