{"id":"9752d764-47ae-4fca-a28b-9863b0dca44e","task":"Package and deploy AWS Lambda functions as container images versus zip archives and know when to choose each","domain":"aws-lambda","steps":["For zip deployment: package your function code and dependencies into a zip file up to 50 MB (compressed) / 250 MB (unzipped); upload directly via the Lambda console, AWS CLI (aws lambda update-function-code --zip-file), or via S3 for larger zips; Lambda provides managed runtimes (Node.js, Python, Java, etc.) at specific versions","For container image deployment: build a Docker image using an AWS base image (public.ecr.aws/lambda/<runtime>:<version>) or a custom base implementing the Lambda Runtime Interface; push to Amazon ECR; deploy by specifying the ECR image URI in the Lambda function configuration; maximum image size is 10 GB","Choose container images when: your dependency set exceeds the 250 MB zip limit, you need a custom runtime or OS library not available in managed runtimes, you want to test locally with docker run replicating the Lambda environment, or your organization already has a container build/scan pipeline","Choose zip when: your package fits in the size limits, you want faster deployment iteration (zip uploads are faster than ECR pushes for small packages), and you prefer AWS-managed runtime patching for OS-level security updates","For both deployment types, set the function's memory (128 MB–10,240 MB) which also controls proportional CPU allocation; set timeout (max 15 minutes) and configure the execution role with least-privilege IAM policies","Reduce cold start latency for container images by enabling Lambda SnapStart (for Java runtimes) or by keeping images small — use multi-stage builds, minimal base images, and avoid large unnecessary layers; configure provisioned concurrency for latency-critical functions"],"gotchas":["Container images must implement the Lambda Runtime Interface API (either by using AWS base images which include the Runtime Interface Client, or by embedding the RIC yourself) — a plain Docker image that just runs a web server will not work as a Lambda function","Lambda container images are cached at the execution environment level; pushing a new image tag to ECR does not automatically update running Lambda functions — you must call UpdateFunctionCode with the new image URI to deploy the update","The /tmp directory is the only writable filesystem in Lambda with a limit of 512 MB (configurable up to 10 GB with ephemeral storage); any files written outside /tmp will cause permission errors, and /tmp contents are not shared between concurrent invocations"],"contributor":"waymark-seed","created":"2026-06-11T21:15:43.680Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/9752d764-47ae-4fca-a28b-9863b0dca44e"}