Skip to content

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 ​

bash
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 NONE

Zip 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 ​

AreaOperations
FunctionsCreateFunction, GetFunction, GetFunctionConfiguration, ListFunctions, UpdateFunctionCode, UpdateFunctionConfiguration, DeleteFunction, Invoke
Versions and aliasesPublishVersion, ListVersionsByFunction, CreateAlias, GetAlias, UpdateAlias, DeleteAlias, ListAliases
Function URLsCreate/Get/Update/Delete/ListFunctionUrlConfig(s)
Event source mappingsCreate/Get/Update/Delete/ListEventSourceMapping(s)
LayersPublishLayerVersion, GetLayerVersion, GetLayerVersionByArn, ListLayers, ListLayerVersions, DeleteLayerVersion, AddLayerVersionPermission, RemoveLayerVersionPermission, GetLayerVersionPolicy
Permissions and policyAddPermission, RemovePermission, GetPolicy, PutResourcePolicy, GetResourcePolicy, DeleteResourcePolicy
Concurrency and scalingPut/Get/DeleteFunctionConcurrency, Put/Get/Delete/ListProvisionedConcurrencyConfig(s), PutFunctionScalingConfig, GetFunctionScalingConfig
Async configPut/Get/Update/Delete/ListFunctionEventInvokeConfig(s)
Capacity providersCreate/Get/Update/Delete/ListCapacityProvider(s)
Code signingCreate/Get/Update/Delete/ListCodeSigningConfig(s), Put/Get/DeleteFunctionCodeSigningConfig, ListFunctionsByCodeSigningConfig
SettingsGetAccountSettings, Put/GetFunctionRecursionConfig, Put/GetRuntimeManagementConfig
TagsTagResource, UntagResource, ListTags
Durable executionGetDurableExecution, CheckpointDurableExecution

Configuration ​

FlagEnvDefaultPurpose
--lambda-docker-hostLAMBDA_DOCKER_HOST172.17.0.1Host containers use to reach the Runtime API
--lambda-container-runtimeCONTAINER_RUNTIMEdockerdocker, podman, auto or kubernetes
--lambda-isolationLAMBDA_ISOLATIONcontainercontainer, gvisor or kata
--lambda-docker-flagsLAMBDA_DOCKER_FLAGSnoneExtra container options: -e, -v, --add-host, --dns, --network, -m, --cpus, --platform
--lambda-pool-sizeLAMBDA_POOL_SIZE3Warm containers per function
--lambda-idle-timeoutLAMBDA_IDLE_TIMEOUT10mIdle container lifetime
--lambda-max-runtimesLAMBDA_MAX_RUNTIMES50Simultaneous per-function runtimes
--lambda-keep-containersLAMBDA_KEEP_CONTAINERSfalseKeep containers alive for debugging
--lambda-disable-hot-reloadLAMBDA_DISABLE_HOT_RELOADfalseDisable hot reload
--lambda-hot-reload-interval-msLAMBDA_HOT_RELOAD_INTERVAL_MS250Minimum time between change scans
--lambda-strict-runtime-validationLAMBDA_STRICT_RUNTIME_VALIDATIONfalseReject deprecated runtimes
--lambda-max-environment-bytesLAMBDA_MAX_ENVIRONMENT_BYTES0 (AWS: 4096)Environment variable size limit
--lambda-code-size-zippedLAMBDA_CODE_SIZE_ZIPPED0 (AWS: 50 MB)Zipped package limit
--lambda-code-size-unzippedLAMBDA_CODE_SIZE_UNZIPPED0 (AWS: 250 MB)Unzipped package limit
--lambda-create-function-request-sizeLAMBDA_CREATE_FUNCTION_REQUEST_SIZE0 (AWS: 70167211)CreateFunction request limit
--lambda-account-total-code-sizeLAMBDA_ACCOUNT_TOTAL_CODE_SIZE0 (AWS: 75 GB)Account code storage limit
--lambda-account-concurrent-executionsLAMBDA_ACCOUNT_CONCURRENT_EXECUTIONS0 (AWS: 1000)Account concurrency limit
--lambda-account-min-unreserved-concurrencyLAMBDA_ACCOUNT_MIN_UNRESERVED_CONCURRENCY0 (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:

yaml
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 1h

Env 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.

RuntimeInjectedAttach with
Node.jsNODE_OPTIONS=--inspect=0.0.0.0:PORTNode inspector
JavaJAVA_TOOL_OPTIONS=-agentlib:jdwp=...,address=*:PORTJDWP remote
PythonPYTHONPATH bootstrap calling debugpy.listen(PORT)debugpy (the package or a layer must contain debugpy)
.NET, Go, otherport published onlystart 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 ​

ModeSandboxRequirement
containerDaemon default OCI runtime (runc), shared host kernelnone
gvisorgVisor (runsc)runsc registered with the Docker daemon
kataKata Containers VMkata or kata-runtime registered with the daemon, plus KVM

Register gVisor in /etc/docker/daemon.json and restart dockerd:

json
{ "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_FLAGS and host DNS/CA injection are not supported on Pods.
  • Telemetry and Logs API: not emitted are platform.restoreStart, RuntimeDone, Report and platform.fault. SnapStart is stored as configuration only; no snapshot is taken or restored.
  • Invoke TenantId is validated but does not route to a tenant-dedicated environment.
  • UpdateFunctionCode SourceKMSKeyArn is stored and echoed only. Function KMSKeyArn encryption of environment variables is real.
  • EFS: subnet, AZ and security-group NFS reachability are checked only as VPC membership. EFSIO and EFSMount* 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: ParallelizationFactor and TumblingWindowInSeconds map 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.
  • SchemaRegistryErrorCount and EventPollerUnit metrics are not emitted.

Parity & Coverage ​

MetricValue
Feature families11 (11 ok)
Known gaps3
Structural gaps (can't be emulated)11
Deferred items0
Resource leaksok

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 export into 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 FamilyStatus
resource_policyok
resource_based_policy_familyok
event_source_mappingsok
datalayer_refactorok
persistenceok
runtime_lifecycleok
function_crud_versions_aliases_layers_concurrency_urls_tagsok
durable_executionok
capacity_providersok
route_reachabilityok
function_urlsok

Released under the MIT License.