You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Approval-gated CI deploy of code-only Lambda changes after a release (OIDC role, production environment) #1445
Credentials: an OIDC role in 966362334030 only, trusted solely for repo:spore-host/spawn:environment:production, from the GitHub OIDC provider. Permissions:
lambda:UpdateFunctionCode, GetFunctionConfiguration, TagResource and ListTags on the named operated functions;
s3:GetObject for the bootstrap-body check;
no IAM, CloudFormation, event-source mapping or stack-parameter changes.
It must respect the account trust boundary: nothing referencing any other account.
The pipeline orchestrator gets code-only updates directly on the function (not sam deploy, which would need CloudFormation execute rights and iam:PassRole). The stack is used only when its parameters change, and that stays manual. Note that SAM drift is then the expected state for Code and must be documented.
Verification, each step failing the job:
CodeSha256 equals the built zip;
the config diff against a pre-deploy snapshot is empty;
Creating the OIDC role is a live IAM change: simulate it allow and deny, plus one real PutRolePolicy. It is done by hand with owner confirmation, not by CI.
CI deploy role created (2026-10-30), owner-approved
The role half shipped in #1449 (merged as 894f731). The workflow half of this issue is still to do.
GitHub environment production (spore-host/spawn), created before the role:
required reviewer scttfrdmn;
can_admins_bypass: false;
deployment policy: tags v* only.
The repo uses the default OIDC subject format (use_default: true), so a job in this environment presents sub = repo:spore-host/spawn:environment:production.
Dry run of scripts/setup-lambda-deploy-ci-role.sh through a recording shim captured the exact trust and policy documents. simulate-custom-policy on that policy, 20 cases, all as intended:
6 allow:UpdateFunctionCode on sweep-orchestrator, ttl-reaper and scheduler-handler; GetFunctionConfiguration; TagResource with the spawn:* keys.
14 deny:
UpdateFunctionCode on spore-bot, on lagotto-capacity-poller, and on the same function name in us-west-2;
Real run from main (the script is byte-identical to the dry-run copy): created role GitHubActions-spawn-lambda-deploy, put inline policy DeployOperatedLambdaCode (9 functions). That PutRolePolicy is the real one.
Live verification:
the trust and inline policy read back from IAM are identical to the dry-run documents;
MaxSessionDuration 3600;
tags spawn:managed/purpose/created-by;
no attached policies, one inline policy.
simulate-principal-policy on the live role, 9 cases, all as intended. Allowed: UpdateFunctionCode on sweep-orchestrator and dns-updater, TagResource with spawn:* keys, ListTags. Denied: spore-rest-api, UpdateFunctionConfiguration, a non-spawn tag key, iam:PutRolePolicy, sts:AssumeRole into another account.
Not yet exercised: an actual AssumeRoleWithWebIdentity from a workflow run. That happens with the first run of the deploy job (the remaining half of this issue).
First live dry run: v0.152.0 (2026-10-31), then LAMBDA_DEPLOY_MODE=live
Release run 41153565390. The owner instructed the approval; I approved the production deployment at 04:43Z. The record is posted on #1455.
Record:DRY RUN (nothing was changed).
Targets:spawn-pipeline-orchestrator and spawn-sweep-orchestrator, both code-only through pkg/aws.
Before SHAs 47CKmNc9… and JvlMv3fs…. These are exactly what the manual v0.151.0 deploy left (record on Release v0.151.0 #1440).
BuiltpKFMXwHf… and YUR4m3e4….
Bootstrap body for v0.152.0 verified (925521a3…).
The SAM drift note is present on pipeline-orchestrator.
Not deployed: 7 unchanged Lambdas, plus setup-lambda-deploy-ci-role.sh as manual (already applied).
Independent verification:
Live state: both functions' CodeSha256, LastModified (2026-10-30 14:3x, the manual deploy) and spawn:version=0.151.0 are unchanged.
CloudTrail, every event for user deploy-lambdas: 2× GetFunctionConfiguration, 2× GetFunction, 1× GetCallerIdentity, 4× KMS Decrypt (Lambda returning function details). All ReadOnly=true. Zero UpdateFunctionCode and zero TagResource.
First real AssumeRoleWithWebIdentity: role GitHubActions-spawn-lambda-deploy, subject repo:spore-host/spawn:environment:production, no error.
Result:LAMBDA_DEPLOY_MODE=live was set at 2026-10-31T04:48Z. From the next release on, the approved deploy job ships code-only changes for real.
Note: this dry run deployed nothing. Both orchestrators still run v0.151.0 code until either a workflow_dispatch of deploy-lambdas.yaml on v0.152.0 with dry_run=false (needs approval) or the next release.
The owner dispatched deploy-lambdas.yaml on v0.152.0 with dry_run=false and approved it in production: run 41170756282, success.
Function
CodeSha256 before → after (= built)
Config diff
spawn:version
spawn-pipeline-orchestrator
47CKmNc9… → pKFMXwHf…
empty
0.151.0 → 0.152.0
spawn-sweep-orchestrator
JvlMv3fs… → YUR4m3e4…
empty
0.151.0 → 0.152.0
Independent verification:
Builds: identical to the dry run's builds, so they are reproducible.
Config: compared against snapshots I took before dispatch, excluding code and update-status fields: zero drift. RuntimeVersionConfig is unchanged. Both functions are Active/Successful.
Tags: the other spawn:* tags are untouched.
CloudTrail, every deploy-lambdas event since 05:00Z: per function, exactly 1 UpdateFunctionCode and 1 TagResource, plus GetFunction×2, GetFunctionConfiguration×4, GetCallerIdentity, and KMS Decrypt (Lambda returning details). No errors, and no call on any other function.
Bootstrap body for v0.152.0 verified, and verify-spored.sh 0.152.0: fail=0 across 231 objects.
Expected drift: stack spawn-pipeline-orchestrator still has Version=0.151.0. The next make -C lambda/pipeline-orchestrator deploy reconciles it.
This was the deployer's first real write path. Rollback was not exercised, because nothing failed. Release-triggered deploys are live from v0.153.0 on (LAMBDA_DEPLOY_MODE=live).
Activity
scripts: role for approval-gated CI deploys of the operated Lambdas (#…
scttfrdmn commentedon Oct 30, 2026
CI deploy role created (2026-10-30), owner-approved
The role half shipped in #1449 (merged as 894f731). The workflow half of this issue is still to do.
GitHub environment
production(spore-host/spawn), created before the role:scttfrdmn;can_admins_bypass: false;v*only.The repo uses the default OIDC subject format (
use_default: true), so a job in this environment presentssub = repo:spore-host/spawn:environment:production.Dry run of
scripts/setup-lambda-deploy-ci-role.shthrough a recording shim captured the exact trust and policy documents.simulate-custom-policyon that policy, 20 cases, all as intended:UpdateFunctionCodeon sweep-orchestrator, ttl-reaper and scheduler-handler;GetFunctionConfiguration;TagResourcewith thespawn:*keys.UpdateFunctionCodeon spore-bot, on lagotto-capacity-poller, and on the same function name in us-west-2;UpdateFunctionConfiguration,UntagResource,CreateFunction,AddPermission,PublishVersion;TagResourcewith a non-spawn key, and on a non-operated function;iam:PutRolePolicy,iam:PassRole,DeleteEventSourceMapping,cloudformation:ExecuteChangeSet.Real run from main (the script is byte-identical to the dry-run copy):
created role GitHubActions-spawn-lambda-deploy,put inline policy DeployOperatedLambdaCode (9 functions). That PutRolePolicy is the real one.Live verification:
spawn:managed/purpose/created-by;simulate-principal-policyon the live role, 9 cases, all as intended. Allowed: UpdateFunctionCode on sweep-orchestrator and dns-updater, TagResource withspawn:*keys, ListTags. Denied: spore-rest-api, UpdateFunctionConfiguration, a non-spawn tag key,iam:PutRolePolicy,sts:AssumeRoleinto another account.Deleter:
AWS_PROFILE=spore-host-infra scripts/setup-lambda-deploy-ci-role.sh --delete.Not yet exercised: an actual
AssumeRoleWithWebIdentityfrom a workflow run. That happens with the first run of the deploy job (the remaining half of this issue).deploy-lambdas workflow, release.yaml caller and gates (#1445)
docs: deploying code-only Lambda changes from CI; CHANGELOG (#1445)
deploylambdas: keep the retired-runtime fixture out of the runtime ce…
Approval-gated CI deploy of code-only Lambda changes (#1445) (#1450)
scttfrdmn commentedon Oct 31, 2026
First live dry run: v0.152.0 (2026-10-31), then
LAMBDA_DEPLOY_MODE=liveRelease run 41153565390. The owner instructed the approval; I approved the
productiondeployment at 04:43Z. The record is posted on #1455.Record:
DRY RUN (nothing was changed).spawn-pipeline-orchestratorandspawn-sweep-orchestrator, both code-only throughpkg/aws.47CKmNc9…andJvlMv3fs…. These are exactly what the manual v0.151.0 deploy left (record on Release v0.151.0 #1440).pKFMXwHf…andYUR4m3e4….925521a3…).setup-lambda-deploy-ci-role.shas manual (already applied).Independent verification:
spawn:version=0.151.0are unchanged.deploy-lambdas: 2× GetFunctionConfiguration, 2× GetFunction, 1× GetCallerIdentity, 4× KMS Decrypt (Lambda returning function details). All ReadOnly=true. Zero UpdateFunctionCode and zero TagResource.AssumeRoleWithWebIdentity: roleGitHubActions-spawn-lambda-deploy, subjectrepo:spore-host/spawn:environment:production, no error.Result:
LAMBDA_DEPLOY_MODE=livewas set at 2026-10-31T04:48Z. From the next release on, the approved deploy job ships code-only changes for real.Note: this dry run deployed nothing. Both orchestrators still run v0.151.0 code until either a
workflow_dispatchof deploy-lambdas.yaml onv0.152.0withdry_run=false(needs approval) or the next release.scttfrdmn commentedon Oct 31, 2026
First LIVE CI deploy: v0.152.0 (2026-10-31)
The owner dispatched
deploy-lambdas.yamlonv0.152.0withdry_run=falseand approved it inproduction: run 41170756282, success.spawn:version47CKmNc9…→pKFMXwHf…JvlMv3fs…→YUR4m3e4…Independent verification:
spawn:*tags are untouched.deploy-lambdasevent since 05:00Z: per function, exactly 1 UpdateFunctionCode and 1 TagResource, plus GetFunction×2, GetFunctionConfiguration×4, GetCallerIdentity, and KMS Decrypt (Lambda returning details). No errors, and no call on any other function.verify-spored.sh 0.152.0: fail=0 across 231 objects.spawn-pipeline-orchestratorstill hasVersion=0.151.0. The nextmake -C lambda/pipeline-orchestrator deployreconciles it.This was the deployer's first real write path. Rollback was not exercised, because nothing failed. Release-triggered deploys are live from v0.153.0 on (
LAMBDA_DEPLOY_MODE=live).