Overview
Production Go Lambdas underapps/*-lambda ship through the Lambda Deploy workflow on every push to prod and through workflow_dispatch (manual Lambda Deploy run).
Each deploy job builds a Linux bootstrap binary, uploads a versioned artifact to S3, and updates the function code via SSM parameters and shared actions under .github/actions/.
Current workers:
Concurrency groups append
${{ github.ref }} (for example refs/heads/prod). Every deploy job uses the same AWS role session name: github-actions-lambda-deploy.
Infrastructure provisioning (queues, IAM, SSM parameter names) lives in the infra repository. See Activity-log SQS and Go Lambda infrastructure.
guideline-ingest
The guideline-ingest worker extracts uploaded guideline documents and indexes guidelines in turbopuffer. The infra repository provides:- An SQS queue with a DLQ. go-svc sends to it through
GUIDELINE_INGEST_SQS_QUEUE_URLand needssqs:SendMessageandsqs:GetQueueAttributes. - A Lambda with a 5 minute timeout, 1536 MB memory, an event source batch size of 1, and partial batch responses enabled. The function name is in the SSM parameter
/hyperlocalise/prod/lambda/guideline-ingest/function_name. - Lambda environment:
DATABASE_URL_SECRET_ARNandDATABASE_SECRET_KEY.TURBOPUFFER_ARNandTURBOPUFFER_KEYfor the API key secret, plusTURBOPUFFER_REGIONandTURBOPUFFER_GUIDELINES_PREFIXmatching go-svc.OBJECT_STORAGE_S3_FILES_BUCKET,OBJECT_STORAGE_S3_FILES_REGIONandOBJECT_STORAGE_DEFAULT_LOCATION. The location ID must match the one go-svc writes intoguideline_documents.storage_location_id.- Optional OCR for scanned PDFs and images:
GUIDELINE_OCR_MODELwithAI_GATEWAY_ARNandAI_GATEWAY_KEY. SetGUIDELINE_IMAGE_UPLOADS_ENABLED=trueon go-svc only when OCR is configured.
- Read access to the object storage bucket.
No path filters
Every push toprod deploys every Lambda. Do not add on.push.paths or per-job path filters.
Path filters used to decide which workers to deploy. They drifted from the real Go import graph. For example, glossary-interchange imports internal/objectstore and memory-interchange imports internal/activitylog, but neither filter listed those packages. A change there would reach prod without redeploying the affected Lambda.
Concurrency
Deploy jobs use per-lambda concurrency groups, for examplelambda-deploy-glossary-interchange-refs/heads/prod, with cancel-in-progress: true. A newer push cancels only the same worker’s in-progress deploy, and the newer run redeploys that worker.
Push deploys also run ensure-deploy-main-tip after checkout. It skips the job when prod has moved past the run’s commit, so an older run never overwrites a newer deploy. workflow_dispatch runs skip the check.
Rules when changing the workflow
- Do add a dedicated
concurrencyblock on each deploy job when you add a new worker. - Do not make deploy jobs conditional on changed paths.
Adding a new worker
Use the create-sqs-lambda-worker skill. At minimum inlambda-deploy.yml:
- Add a deploy job with
if: github.ref == 'refs/heads/prod'. - Add job-level
concurrencywith a unique group name (lambda-deploy-<worker>-${{ github.ref }}). - Call
ensure-deploy-main-tipafter checkout. - Set
role-session-name: github-actions-lambda-deployon the new job’sconfigure-aws-credentialsstep (same value as every other deploy job onprod).
Do not change when launching a new Lambda
When you add a worker, extend the workflow. Do not refactor existing deploy jobs or shared CI behavior.- Do not use per-worker
role-session-namevalues. All Lambda deploy jobs onprodusegithub-actions-lambda-deployonly. - Do not change
role-session-nameon existing deploy jobs when adding a worker. - Do not add path filters.
- Do not remove
ensure-deploy-main-tipor per-job concurrency from existing workers. - Do not change existing concurrency group names for workers already in production.
AGENTS.md summarizes the same rules for automation.
Operations
Open the completed deploy job onprod. The Summarize step writes function name, S3 URI, version id, and commit SHA to the job summary.
