Lambda
Parity grade: A · SDK aws-sdk-go-v2/service/lambda@v1.112.2 · last audited 2026-10-07 (51ea2ace0) · protocol REST-JSON
Category: Compute · View PARITY.md on GitHub · All Services
Lambda functions run in containers. Supports image and zip packages, layers, versions and aliases, function URLs, event source mappings, capacity providers and code signing. Architecture details: Lambda architecture.
IMPORTANT
A container runtime (Docker by default, or Podman) must be reachable to invoke functions.
Quick start
export AWS_ENDPOINT_URL=http://localhost:8000
aws lambda create-function --function-name my-function \
--package-type Image \
--code ImageUri=public.ecr.aws/lambda/python:3.12 \
--role arn:aws:iam::000000000000:role/my-role
aws lambda invoke --function-name my-function --payload '{"key":"value"}' response.json
aws lambda invoke --function-name my-function --invocation-type Event \
--payload '{"key":"value"}' /dev/null
aws lambda update-function-code --function-name my-function --image-uri myrepo/myimage:v2
aws lambda create-event-source-mapping --function-name my-function \
--event-source-arn arn:aws:sqs:us-east-1:000000000000:my-queue --batch-size 10
aws lambda create-function-url-config --function-name my-function --auth-type NONEZip functions take --zip-file or --code S3Bucket=...,S3Key=.... With the magic bucket hot-reload, S3Key is a local directory mounted into the function, and changes are picked up without redeploying. Disable with LAMBDA_DISABLE_HOT_RELOAD.
Supported operations
| Area | Operations |
|---|---|
| Functions | CreateFunction, GetFunction, GetFunctionConfiguration, ListFunctions, UpdateFunctionCode, UpdateFunctionConfiguration, DeleteFunction, Invoke |
| Versions and aliases | PublishVersion, ListVersionsByFunction, CreateAlias, GetAlias, UpdateAlias, DeleteAlias, ListAliases |
| Function URLs | Create/Get/Update/Delete/ListFunctionUrlConfig(s) |
| Event source mappings | Create/Get/Update/Delete/ListEventSourceMapping(s) |
| Layers | PublishLayerVersion, GetLayerVersion, GetLayerVersionByArn, ListLayers, ListLayerVersions, DeleteLayerVersion, AddLayerVersionPermission, RemoveLayerVersionPermission, GetLayerVersionPolicy |
| Permissions and policy | AddPermission, RemovePermission, GetPolicy, PutResourcePolicy, GetResourcePolicy, DeleteResourcePolicy |
| Concurrency and scaling | Put/Get/DeleteFunctionConcurrency, Put/Get/Delete/ListProvisionedConcurrencyConfig(s), PutFunctionScalingConfig, GetFunctionScalingConfig |
| Async config | Put/Get/Update/Delete/ListFunctionEventInvokeConfig(s) |
| Capacity providers | Create/Get/Update/Delete/ListCapacityProvider(s) |
| Code signing | Create/Get/Update/Delete/ListCodeSigningConfig(s), Put/Get/DeleteFunctionCodeSigningConfig, ListFunctionsByCodeSigningConfig |
| Settings | GetAccountSettings, Put/GetFunctionRecursionConfig, Put/GetRuntimeManagementConfig |
| Tags | TagResource, UntagResource, ListTags |
| Durable execution | GetDurableExecution, CheckpointDurableExecution |
Configuration
| Flag | Env | Default | Purpose |
|---|---|---|---|
--lambda-docker-host | LAMBDA_DOCKER_HOST | 172.17.0.1 | Host containers use to reach the Runtime API |
--lambda-container-runtime | CONTAINER_RUNTIME | docker | docker, podman, auto or kubernetes |
--lambda-isolation | LAMBDA_ISOLATION | container | container, gvisor or kata |
--lambda-docker-flags | LAMBDA_DOCKER_FLAGS | none | Extra container options: -e, -v, --add-host, --dns, --network, -m, --cpus, --platform |
--lambda-pool-size | LAMBDA_POOL_SIZE | 3 | Warm containers per function |
--lambda-idle-timeout | LAMBDA_IDLE_TIMEOUT | 10m | Idle container lifetime |
--lambda-max-runtimes | LAMBDA_MAX_RUNTIMES | 50 | Simultaneous per-function runtimes |
--lambda-keep-containers | LAMBDA_KEEP_CONTAINERS | false | Keep containers alive for debugging |
--lambda-disable-hot-reload | LAMBDA_DISABLE_HOT_RELOAD | false | Disable hot reload |
--lambda-hot-reload-interval-ms | LAMBDA_HOT_RELOAD_INTERVAL_MS | 250 | Minimum time between change scans |
--lambda-strict-runtime-validation | LAMBDA_STRICT_RUNTIME_VALIDATION | false | Reject deprecated runtimes |
--lambda-max-environment-bytes | LAMBDA_MAX_ENVIRONMENT_BYTES | 0 (AWS: 4096) | Environment variable size limit |
--lambda-code-size-zipped | LAMBDA_CODE_SIZE_ZIPPED | 0 (AWS: 50 MB) | Zipped package limit |
--lambda-code-size-unzipped | LAMBDA_CODE_SIZE_UNZIPPED | 0 (AWS: 250 MB) | Unzipped package limit |
--lambda-create-function-request-size | LAMBDA_CREATE_FUNCTION_REQUEST_SIZE | 0 (AWS: 70167211) | CreateFunction request limit |
--lambda-account-total-code-size | LAMBDA_ACCOUNT_TOTAL_CODE_SIZE | 0 (AWS: 75 GB) | Account code storage limit |
--lambda-account-concurrent-executions | LAMBDA_ACCOUNT_CONCURRENT_EXECUTIONS | 0 (AWS: 1000) | Account concurrency limit |
--lambda-account-min-unreserved-concurrency | LAMBDA_ACCOUNT_MIN_UNRESERVED_CONCURRENCY | 0 (AWS: 100) | Minimum unreserved concurrency |
Remote debugging
Set LAMBDA_DEBUG_MODE=1 to publish a debugger port from a function's container to 127.0.0.1. Configure functions with a YAML/JSON file (LAMBDA_DEBUG_MODE_CONFIG_PATH) or LAMBDA_DEBUG_MODE_FUNCTIONS=name=5678,other:1=5679:
functions:
arn:aws:lambda:us-east-1:000000000000:function:my-fn: # or "my-fn" / "my-fn:3"
debug-port: 5678
enforce-timeouts: false # default true; false raises the invoke timeout to 1hEnv form: LAMBDA_DEBUG_MODE_ENFORCE_TIMEOUTS=false. Each function needs a distinct port. A port collision, duplicate function or bad port disables debug mode and logs an error at startup.
| Runtime | Injected | Attach with |
|---|---|---|
| Node.js | NODE_OPTIONS=--inspect=0.0.0.0:PORT | Node inspector |
| Java | JAVA_TOOL_OPTIONS=-agentlib:jdwp=...,address=*:PORT | JDWP remote |
| Python | PYTHONPATH bootstrap calling debugpy.listen(PORT) | debugpy (the package or a layer must contain debugpy) |
| .NET, Go, other | port published only | start vsdbg or dlv --listen=:PORT yourself |
A debug-mode function keeps one warm container that idle reaping and LRU eviction skip. Invocations queue on it. A qualifier in the config matches only that published version.
Isolation modes
| Mode | Sandbox | Requirement |
|---|---|---|
container | Daemon default OCI runtime (runc), shared host kernel | none |
gvisor | gVisor (runsc) | runsc registered with the Docker daemon |
kata | Kata Containers VM | kata or kata-runtime registered with the daemon, plus KVM |
Register gVisor in /etc/docker/daemon.json and restart dockerd:
{ "runtimes": { "runsc": { "path": "/usr/local/bin/runsc" } } }At startup Gopherstack lists the daemon's runtimes and refuses to start if the one for the chosen mode is missing. --lambda-isolation=firecracker is rejected at startup.
Differences from AWS
CONTAINER_RUNTIME=kubernetes: EFS file systems, hot reload, layer extensions,LAMBDA_DOCKER_FLAGSand host DNS/CA injection are not supported on Pods.- Telemetry and Logs API: not emitted are
platform.restoreStart,RuntimeDone,Reportandplatform.fault. SnapStart is stored as configuration only; no snapshot is taken or restored. - Invoke
TenantIdis validated but does not route to a tenant-dedicated environment. UpdateFunctionCodeSourceKMSKeyArnis stored and echoed only. FunctionKMSKeyArnencryption of environment variables is real.- EFS: subnet, AZ and security-group NFS reachability are checked only as VPC membership.
EFSIOandEFSMount*errors are never raised. - Capacity providers: execution environments are logical slots over the function's single container, not separate containers or instances.
- Stream event source mappings:
ParallelizationFactorandTumblingWindowInSecondsmap records onto ordered lanes by key. - Kafka and MQ mappings: MSK and Amazon MQ sources are polled only when a real broker runs (
--kafka-engine=docker,--mq-engine=docker). Self-managed Kafka reaches plaintext brokers only;SourceAccessConfigurations(SASL, mTLS, TLS CA, VPC) and MSK auth settings are ignored. ActiveMQ is consumed over STOMP, not OpenWire. SchemaRegistryErrorCountandEventPollerUnitmetrics are not emitted.
Parity & Coverage
| Metric | Value |
|---|---|
| Feature families | 11 (11 ok) |
| Known gaps | 3 |
| Structural gaps (can't be emulated) | 11 |
| Deferred items | 0 |
| Resource leaks | ok |
Known Gaps
- CONTAINER_RUNTIME=kubernetes (Pod executor, gopherstack-49qct.87): EFS file systems, hot reload, layer extensions, LAMBDA_DOCKER_FLAGS and host DNS/CA injection are not supported on Pods; those functions fail to start or skip the feature. Tracked in gopherstack-49qct.88.
- Telemetry/Logs API (gopherstack-49qct.91): not emitted -- platform.restoreStart/RuntimeDone/Report (SnapStart is stored as configuration only, no snapshot is taken or restored, handler_functions.go applySnapStart), platform.fault (Logs API; no documented trigger or record shape), and spans on init events (telemetry-schema-reference defines no init span names); extensions of image functions without /bin/sh are not started and unclassified internal/external
- --lambda-isolation=firecracker is rejected at startup: no firecracker binary is installed on the build host, so no microVM runner exists. Design: export the function image with
docker exportinto an ext4 rootfs, boot it under firecracker with a configured kernel image (--lambda-firecracker-kernel), and reach the Runtime API over vsock (or a TAP device) instead of the docker bridge. Needs /dev/kvm access and a firecracker binary to build and test (gopherstack-cefu7.7).
Structural Gaps
These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.
- Stream ESM ParallelizationFactor/TumblingWindowInSeconds: records are hashed by partition key (Kinesis) or item key (DynamoDB) onto N ordered lanes, drained concurrently; a retrying lane pauses reads for the whole shard, tumbling state is kept per lane, and windows close on the clock only once the shard is caught up (Kinesis's up-to-2-minute idle wait is not modeled).
- ESM SchemaRegistryErrorCount and EventPollerUnit metrics: no Glue/Confluent schema-registry integration or poller-unit billing model exist to measure (ProvisionedPollers is emitted for SQS mappings with ProvisionedPollerConfig).
- Kafka ESM LoggingConfig DEBUG offsets are logged on every commit, not once a minute, and omit endOffset; INFO/WARN omit securityProtocol, saslMechanism, networkConfig, assignedPartitions (no VPC/auth/rebalance model).
- Invoke TenantId is validated (required for PER_TENANT, rejected otherwise) but does not route to a tenant-dedicated execution environment: one environment pool per function.
- Kafka ESM: MSK sources are polled only when services/kafka runs a real broker (--kafka-engine=docker); metadata-only MSK clusters stay unpolled with a warning, and MSK auth settings (IAM/SCRAM/TLS) are ignored (gopherstack-ce985).
- MQ ESM: Amazon MQ sources are polled only when services/mq runs a real broker (--mq-engine=docker); metadata-only brokers stay unpolled with a warning. ActiveMQ is consumed over STOMP (AWS uses OpenWire/JMS), so brokerInTime is the message timestamp and messageType is inferred from STOMP content-length; one queue per mapping (Queues[0]); no TLS; the BASIC_AUTH secret must be JSON with username/password keys (the Lambda guide does not show its layout) and is read from services/secretsmanager in the secret ARN's region.
- Kafka ESM (self-managed): SourceAccessConfigurations (SASL/SCRAM, mTLS, TLS root CA, VPC) are ignored -- only plaintext brokers are reachable -- and per-partition concurrency is not modeled (gopherstack-ce985).
- ESM SQS concurrency: with ScalingConfig.MaximumConcurrency (2..1000) or ProvisionedPollerConfig the mapping runs concurrent batch workers (cap = MaximumConcurrency, or pollers x 10 within Min..Max, doubling/halving with backlog). Without either, a mapping still processes one batch per tick, whereas AWS starts at 5 concurrent batches and scales up. Kafka/MSK ProvisionedPollerConfig and EventPollerUnit are stored only; the emulator's Kafka worker is one consumer per mapping.
- UpdateFunctionCode SourceKMSKeyArn is stored and echoed only: no deployment-package encryption exists to apply the key to. Function KMSKeyArn encryption of environment variables is real (see the 2026-10-25 note); KMS Decrypt grants/key policies are not consulted (the emulated KMS has no principal for Lambda), so KMSAccessDeniedException arises only for a non-encrypt/decrypt key or a ciphertext/encryption-context mismatch.
- FileSystemConfigs: mount-target subnet/AZ and security-group NFS reachability are checked only as VPC membership. EFSIO/EFSMount* exceptions are never raised. Deleting an access point a function references is allowed, as no EFS error documents otherwise. The access point PosixUser is applied by running the whole function process as that uid:gid (+ supplementary gids), not per-file NFS identity squashing, and RootDirectory CreationInfo ownership is chowned only when the emulator itself runs privileged (permissions are always applied).
- Capacity providers (Lambda Managed Instances): execution environments are logical slots over the function's single local container, not separate containers or EC2 instances. Invocations are admitted per environment (PerExecutionEnvironmentMaxConcurrency; unset defaults per vCPU follow the runtime guides: nodejs 64, java/dotnet 32, python 16; runtimes with no documented default, e.g. provided/go/ruby, are uncapped per environment), environments scale out to FunctionScalingConfig max and the provider MaxVCpuCount (default 400), min defaults to 3; ScalingMode/ScalingPolicies, InstanceRequirements, VpcConfig and throttle-reason metrics (CPUThrottles/MemoryThrottles) are accepted and echoed but do not influence routing, and exhausted capacity is a synchronous 429 where AWS scales out asynchronously.
Audited Feature Families
| Feature Family | Status |
|---|---|
resource_policy | ok |
resource_based_policy_family | ok |
event_source_mappings | ok |
datalayer_refactor | ok |
persistence | ok |
runtime_lifecycle | ok |
function_crud_versions_aliases_layers_concurrency_urls_tags | ok |
durable_execution | ok |
capacity_providers | ok |
route_reachability | ok |
function_urls | ok |
