Repository navigation
Add reusable workflows to build and deploy a Lambda zip - #46
Merged
Merged
Conversation
build-lambda.yml runs in the repository that holds a function's source: it installs the locked dependencies as Lambda-platform wheels, runs the tests, zips the package reproducibly, uploads it write-once to the package bucket, attests it with its pull request, tests, lockfile, SBOM and runtime, and evaluates the SDLC controls, SDLC-CTRL-0004 with its zip variant. deploy-lambda.yml downloads that package, checks its SHA-256 and swaps a function's code in every account of an environment type, behind one GitHub environment approval when one is named. Adds the handover for kosli-dev/server#7913. See kosli-dev/server#7913 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jumboduck
approved these changes
Nov 10, 2026
ToreMerkely
enabled auto-merge
November 10, 2026 14:28
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.
What changed
Adds
build-lambda.ymlanddeploy-lambda.yml, the golden pipeline for Lambda zip packages: the repository that holds a function's source builds, attests and deploys it. Adds the #7913 handover.Part of kosli-dev/server#7913
Why
apply.ymlattests each Lambda's fingerprint to the Terraform apply's trail, whose pull request reviewed the Terraform and not necessarily the code. Building in the source repository puts the package on a trail with the PR, tests and dependencies that produced it, so the SDLC controls can be decided for it.build-lambda.yml(inputspackage_name,source_path,python_version,bundle_kosli_cli,bundled_kosli_cli_version,controls):uv.lockorrequirements.txtasmanylinuxwheels for the runtime's Python, with no Docker, and runspytestwhen there aretest_*.pyfiles;lambda-packages-<hash>under<repo>/<package>/<sha>.zipaslambda-package-publisher(terraform-base-infra#1247), refusing to overwrite, and accepting an existing key whose checksum matches;<repo>-<package>, trail = commit;evaluate-policy.ymlwithvariants: {"SDLC-CTRL-0004": "zip"}(kosli-dev/sdlc-policies#59, #60), passing SDLC-CTRL-0008's params only when it is evaluated.deploy-lambda.yml(inputss3_key,fingerprint,function_name,environments,github_environment,role_name): fetches the accounts fromterraform-deploy-matrix, waits for one approval job whengithub_environmentis set, then per account downloads the package, checks its SHA-256 and runsupdate-function-code --publish. Deploys pass the zip's bytes, so Lambda never reads the bucket.Verification
make testpasses (102 tests).kosli-queue-sampler, produced byte-identical zips containingmain.pyandredis.controls.Follow-ups
Recorded in the handover's Next Steps:
kosli-queue-samplerin terraform-server:boto3declared, a deploy role per account,ignore_changeson the function's code, and a check of the version-qualified EventBridge permission.lambda-package-publisher's trust onjob_workflow_refis verified only by the first build run.🤖 Generated with Claude Code