Application teams that ship to AWS Lambda spend most of their deployment effort on three concerns: how the code arrives at the service, which configuration knobs are set on the function, and how new code reaches production traffic without breaking it. None of these are about runtime behavior; they sit between the artifact a developer produces locally and the version that handles requests. The certification tests whether a developer can identify the right packaging format for a workload, set the function configuration that the workload requires, and pick a traffic-shifting pattern that matches its blast-radius budget.
Lambda accepts code in two shapes: a ZIP archive uploaded to the function (directly or by way of an Amazon S3 object), or a container image stored in Amazon ECR. The ZIP path is bounded by a 50 MB direct-upload limit, a 250 MB unzipped limit including layers, and a 10 MB inline editor limit; the container path raises the unzipped limit to 10 GB. Functions deployed from a ZIP run on the Amazon Linux 2 or Amazon Linux 2023 managed runtimes; functions deployed from an image must include a runtime interface client and emulator, and they boot from the OCI image layers AWS pulls into the execution environment. Both shapes share the same invocation surface, so changing packaging does not change a function's event source mappings, environment variables, IAM execution role, or destinations.
Layers are how teams share libraries and binaries across functions without baking them into each artifact. A layer is itself a ZIP archive uploaded once and referenced by ARN from any function in the same Region; up to five layers attach to a function, and the combined unzipped size of the function and all layers must stay under 250 MB. The contents are extracted into /opt at cold-start time, with language-specific subpaths (/opt/python for Python, /opt/nodejs/node_modules for Node.js, /opt/java/lib for Java). Layer versions are immutable, which is why teams pin a function to a specific layer ARN with a version suffix instead of a layer name; an unpinned reference would not work because the API requires a version.
Function configuration drives both performance and cost. The memory setting controls allocated memory between 128 MB and 10,240 MB; CPU scales linearly with memory, so a memory-bound function and a CPU-bound function tune the same knob. Timeout is bounded at 15 minutes. Reserved concurrency carves a fixed share of account-level concurrency for one function and acts as both a ceiling and a guarantee. Provisioned concurrency pre-initializes execution environments so requests skip the cold start; it bills per GB-second of warm capacity plus per-request invocations. Ephemeral storage (/tmp) is configurable from 512 MB to 10,240 MB. Environment variables are key-value pairs encrypted at rest with an AWS-managed or customer-managed KMS key and decrypted at function start; the four-kilobyte total limit on all variables for a function is a regular distractor.
Two additional configuration surfaces sit on top of these knobs. Destinations route asynchronous-invocation outcomes (success or failure) to Amazon SQS, Amazon SNS, AWS Lambda, or Amazon EventBridge, replacing the older dead-letter-queue-only pattern for failed asynchronous executions. Function URLs expose a function as an HTTPS endpoint with AWS IAM authentication or no authentication at all, scoped by a CORS configuration. Lambda extensions, packaged as layers under /opt/extensions, run inside the same execution environment as the function and observe lifecycle hooks (INIT, INVOKE, SHUTDOWN); observability vendors and the AWS Lambda Powertools project ship extensions for log shipping, secret fetching, and telemetry export.
API mocking with Amazon API Gateway
Before a Lambda integration exists, an Amazon API Gateway can return a mocked response that lets consumers exercise the contract. A mock integration sits on a method, and the integration response is built from a Velocity Template Language (VTL) mapping template that ignores the request payload. Mock integrations cost the standard request charge and do not invoke Lambda, which makes them the recommended path for early-stage testing and offline development. The MOCK integration type is exclusive to REST APIs; HTTP APIs do not support mocks, and teams that need them on an HTTP API fall back to returning a fixed response from a tiny Lambda function or from a static Amazon S3 file behind a CloudFront distribution.
# OpenAPI fragment for a REST API mock integration
paths:
/widgets:
get:
x-amazon-apigateway-integration:
type: mock
requestTemplates:
application/json: '{"statusCode": 200}'
responses:
default:
statusCode: "200"
responseTemplates:
application/json: |
{"widgets":[{"id":"abc-1","color":"red"}]}
Deployment strategy configuration: canary, blue/green, rolling
Lambda traffic shifting is implemented by aliases and by AWS CodeDeploy. An alias is a named pointer to a function version, and an alias can split traffic across two versions with a defined weight. CodeDeploy reads a Hooks block and a deployment configuration name, then it walks the alias through the configured pattern: Canary10Percent5Minutes, Canary10Percent10Minutes, Canary10Percent15Minutes, Canary10Percent30Minutes, Linear10PercentEvery1Minute, Linear10PercentEvery2Minutes, Linear10PercentEvery3Minutes, Linear10PercentEvery10Minutes, or AllAtOnce. Canary shifts a fixed slice immediately and the rest after a bake window; linear ramps in equal slices over equal intervals; all-at-once skips the safety bake. Each shift fires a pre-traffic and a post-traffic hook (themselves Lambda functions) that can run smoke tests and abort the deployment by returning a failure to CodeDeploy.
Blue/green on Lambda is conceptually identical to the alias-based shift: the "blue" environment is the version the alias points at, and the "green" environment is the new version. Blue/green on Amazon ECS, Amazon EC2 Auto Scaling Groups, and Amazon EKS works the same way through CodeDeploy but with a fresh fleet behind the new task set or target group; rolling deployments replace instances in place without a parallel fleet. The exam tests these mappings: Lambda is canary or linear (which the documentation also calls "blue/green for Lambda"), ECS and EC2 are blue/green or in-place, and Elastic Beanstalk handles rolling, rolling-with-additional-batch, immutable, and traffic-splitting modes inside its own platform.
# Publish a new Lambda version and shift 10 percent of traffic to it
aws lambda update-function-code \
--function-name orders-api \
--zip-file fileb://orders-api.zip \
--publish
aws lambda update-alias \
--function-name orders-api \
--name live \
--function-version 7 \
--routing-config 'AdditionalVersionWeights={"6"=0.9}'
# Or let CodeDeploy run the canary with a deployment configuration
aws deploy create-deployment \
--application-name orders-api \
--deployment-group-name orders-canary \
--deployment-config-name CodeDeployDefault.LambdaCanary10Percent5Minutes \
--revision revisionType=AppSpecContent,appSpecContent={...}
{
"version": 0.0,
"Resources": [
{
"orders-function": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Name": "orders-api",
"Alias": "live",
"CurrentVersion": "6",
"TargetVersion": "7"
}
}
}
],
"Hooks": [
{"BeforeAllowTraffic": "orders-pre-traffic-check"},
{"AfterAllowTraffic": "orders-post-traffic-check"}
]
}
Choosing the function configuration that fits the workload
The exam often presents a workload sketch (latency budget, traffic shape, payload size, concurrency expectations) and asks for the right configuration knob. A latency-sensitive synchronous API behind API Gateway with predictable traffic peaks is the canonical case for provisioned concurrency on the alias the API targets. A workload that must not exhaust the account-wide pool gets reserved concurrency, which both caps it and guarantees it. A function that writes large temporary files during a video transform needs /tmp raised above the 512 MB default. A function that batches messages from an Amazon SQS queue gets its concurrency controlled through the event source mapping's MaximumConcurrency, not by an alias.
💡 Exam Trap: Reserved concurrency and provisioned concurrency are not synonyms. Reserved concurrency is a CEILING (and a guarantee) that caps how many simultaneous executions one function may run; provisioned concurrency is PRE-INITIALIZED execution environments that remove cold starts. A scenario that says "eliminate cold starts" wants provisioned; a scenario that says "protect other functions from runaway invocations" wants reserved.
💡 Exam Trap: The unzipped 250 MB ceiling on a ZIP-packaged Lambda function INCLUDES every attached layer. Splitting a heavy dependency into a layer does NOT raise the total; it just moves bytes off the function package. Workloads that need more than 250 MB unzipped must switch to container images, which raise the limit to 10 GB.
⚠️ Anti-Pattern: Hard-coding a function version into client code or another upstream service. The alias-and-version model exists precisely so that callers reference a stable name (
live,staging) and traffic shifts happen invisibly. Pinning callers to a numeric version breaks rollback by alias and turns every deploy into a coordinated cross-service change.
🎯 Scenario: An e-commerce checkout function packaged at 180 MB unzipped runs behind an Amazon API Gateway REST API. The team observes spikes of cold-start latency at the start of each promo wave and wants to keep the function under 250 MB to stay on the ZIP path. The right answer is provisioned concurrency on the
livealias sized to the expected concurrency floor, plus reserved concurrency well above that floor so the function is not starved during a Region-wide concurrency event. Container images are unnecessary; the package fits under the ZIP limit.
📊 Limit: A Lambda function may attach up to FIVE layers, the combined unzipped size of function and layers may not exceed 250 MB, environment variables for a function may not exceed 4 KB total, and the function timeout may not exceed 15 minutes.
Decision Anchor. Choose ZIP packaging when the unzipped artifact fits under 250 MB and the team is comfortable on the managed runtimes. Choose a container image when the artifact exceeds 250 MB unzipped, the team needs a custom runtime that AWS does not offer as a managed runtime, or the team already standardizes on OCI images for parity with non-Lambda services. Choose canary deployment configurations when the workload tolerates a small slice of bad traffic for a bake window; choose linear when teams want gradual ramping; choose all-at-once only when downtime risk is irrelevant or rollback is trivial.
