Skip to content

AWS Lambda deploy

Each connector ships as an OCI image that runs on AWS Lambda (container image runtime). Two lanes per connector share one ECR repo and one image:

Lane Function Trigger
dev woos-connectors-<connector>-dev Push to master (automatic)
prod woos-connectors-<connector> workflow_dispatch with environment=prod

Pipeline

.github/workflows/deploy-aws.yml runs on:

  • Pushes to master that touch monoprix/, mcdonalds/, or the workflow itself. Lane is forced to dev.
  • workflow_dispatch with inputs connector and environment (dev or prod, default prod).

For each targeted connector it:

  1. Assumes the deploy role via GitHub OIDC (vars.CONNECTORS_DEPLOYER_ROLE_ARN, provisioned by the operations repo).
  2. Logs in to ECR with aws-actions/amazon-ecr-login.
  3. Builds linux/arm64 with docker buildx on a native ubuntu-24.04-arm runner (no qemu) and pushes two tags to woos-connectors/<connector>: <sha> and latest. --provenance=false --sbom=false --output type=image,push=true,oci-mediatypes=false keep the image a single Docker v2 manifest; Lambda rejects any OCI image-index.
  4. Calls aws lambda update-function-code on the lane's function with the <sha> image URI, then waits with aws lambda wait function-updated-v2.

Image layout

Both Dockerfiles use public.ecr.aws/lambda/python:3.14 (the AWS-maintained base image) and the canonical uv pattern from docs.astral.sh/uv/guides/integration/aws-lambda/:

  • A multi-stage build mounts uv.lock + pyproject.toml, runs uv export --frozen --no-emit-workspace --no-dev --no-editable to produce an ephemeral requirements.txt, and installs it with uv pip install --target "${LAMBDA_TASK_ROOT}".
  • The final stage copies ${LAMBDA_TASK_ROOT} and the application sources into the AWS Lambda runtime image. handler.handler wraps the FastAPI application in Mangum.

The base image already carries the AWS Lambda runtime API; no extra packages are needed. curl_cffi on McDonald's installs from its prebuilt manylinux arm64 wheels.

Rolling back

aws lambda update-function-code \
  --function-name woos-connectors-<connector>[-dev] \
  --image-uri <registry>/woos-connectors/<connector>:<older-sha>

Every build SHA stays in ECR under the connector repository (20 tagged images retained, 7 days for untagged).