Easy ReviewDOP-C02
SDLC Automation78

Lambda

Run event-driven functions with source-specific retries, controlled capacity, least-privilege access, and versioned releases.

Lambda runs code in response to invocations. Choose the invocation path first, then configure retries, permissions, runtime resources, and release routing for that path.

Lambda basics

AWS Lambda runs your code when an event happens, with no servers for you to manage.

How it works

  1. Write a function and choose a trigger.
  2. When the event happens, Lambda runs the function.
  3. Lambda scales the number of runs with the events.

Exam cues

  • If the question says run code on an event without managing servers, think Lambda.

Remember

  • Serverless: no servers to provision or patch.

Trap: Lambda is serverless compute for event-driven code; long-running servers you control are EC2.

From the AWS docs (4)
  • AWS Lambda runs code without provisioning or managing servers; AWS handles capacity, scaling and patching.
  • A Lambda function runs in response to events or API calls from triggers such as API Gateway, Amazon S3, Amazon SQS and EventBridge.
  • AWS Lambda runs code without servers to provision or manage; AWS handles server maintenance, capacity provisioning and scaling, and you pay only for the resources used.
  • Other AWS services, such as Amazon S3 and Amazon DynamoDB, can invoke Lambda functions with events.

Invocation and retries

Lambda runs function code in response to invocationsA request to run a function., meaning requests to execute the function. A synchronous caller waits for the result; an asynchronous caller hands work to Lambda’s event queue. The invocation path determines who owns retries.

How it works

  1. For a direct synchronous request, Lambda runs the handlerThe function entry point that processes an invocation event., the function that processes the event, and returns its result. The caller decides whether to retry a function error.
  2. For asynchronous invocationA function invocation that places an event in a Lambda-managed queue for later processing., Lambda queues the event and later runs the function. Function errors get two retries by default, after waits of one minute and then two minutes.
  3. Set MaximumRetryAttempts for function errors. An event can arrive twice even after success, so processing must be idempotentThe property that repeating the same operation causes no additional side effects.: repeating the same event must not create extra effects.
  4. An event source mappingA Lambda resource that reads queue or stream records and invokes a function with batches., a Lambda resource that reads a queue or stream, follows its source-specific retry rules. For SQS, configure visibility timeoutThe period during which a received queue message is hidden from other consumers. and the source queue’s redrive policyAn SQS source-queue setting that moves messages to a dead-letter queue after a configured receive count., which moves repeatedly received messages to a failure queue.
  5. Set timeout, memory, and temporary storage for the work. More memory also provides more CPU capacity. Each environment has its own encrypted /tmp scratch directory.
  6. For long-running workflows, a Lambda durable function uses checkpoints, saved progress for operations, and replay. Replay reuses completed checkpoint results; waits suspend execution without compute charges.
Invocation path Result delivery Function-error retry owner
Direct synchronous Caller waits for result Caller
Asynchronous Lambda queues the event Lambda
SQS mapping Lambda reads a queue batchA group of records passed to a function in one invocation. Mapping and queue settings

An Application Load Balancer (ALB) invokes a Lambda target directly with a JSON request, rather than opening a network connection to the function. Return a JSON response with statusCode, isBase64Encoded, headers, and body.

Exam cues

  • If the question says a synchronous Lambda call failed, think caller retry logic, because Lambda does not automatically retry that function error.
  • If the question says CPU-bound Lambda processing is slow, think increasing memory, because CPU capacity scales with memory.
  • If the question says a Lambda workflow must wait for a human decision for days and resume after interruption, think a durable function, because it checkpoints progress and supports long waits.

Remember

  • Function-error retries: 2 by default, configurable from 0 to 2.
  • Timeout: 3 seconds by default, normally 1 through 1,800 seconds (900 until November 2026). Lambda Managed Instances permit up to 5,400 seconds for asynchronous and event source mapping invocations except Amazon MQ and Amazon DocumentDB.
  • Memory: 128 MB by default, 128 through 10,240 MB in 1-MB steps. At 1,769 MB, CPU capacity equals one virtual CPU (vCPU).
  • Temporary storage: 512 through 10,240 MB in 1-MB steps, per environment.
  • Durable executions can last up to one year. In November 2026 the default running-execution quota rose from one million to five million per account, with twice that new quota in N. Virginia, Oregon, and Ireland.
  • Lambda: no servers to manage, pay for what you use; S3 and DynamoDB events can trigger it.
  • Lambda pricing: requests plus duration (GB-seconds); free tier 1 million requests and 400,000 GB-seconds a month.
  • Lambda Managed Instances: EC2 capacity from a capacity provider, EC2 pricing options, several invocations per environment.

Trap: Disabling asynchronous function-error retries does not prevent duplicate events.

Asynchronous invocation separates acceptance from execution
12CallerLambda queueHandler
  1. The caller submits an event to the Lambda-managed asynchronous queue.

  2. Lambda invokes the handler and applies asynchronous retry rules.

ALB converts HTTP requests into Lambda events
12HTTP clientALBLambda target
  1. The client sends an HTTP request to the Application Load Balancer.

  2. ALB invokes the Lambda target with a JSON request; the function returns a JSON response.

From the AWS docs (25)
  • A synchronous invocation waits for the function result.
  • Lambda does not automatically retry function-code errors for direct synchronous invocations; the caller decides whether to retry.
  • Lambda manages an internal event queue for asynchronous invocations.
  • By default, Lambda retries an asynchronous function error twice, waiting one minute before the second attempt and two minutes before the third.
  • MaximumRetryAttempts controls asynchronous function-error retries and accepts 0 through 2.
  • Asynchronous invocation can deliver duplicate events even when the function succeeds.
  • For SQS event source mappings, source-queue visibility timeout and redrive policy control retries and failed-message handling.
  • The Lambda function timeout defaults to three seconds.
  • The normal Lambda function timeout can be set from 1 to 1,800 seconds, in one-second increments.
  • In November 2026 the Lambda documentation raised the maximum function timeout from 900 seconds (15 minutes) to 1,800 seconds (30 minutes).
  • Lambda Managed Instances allow up to 5,400 seconds for asynchronous invocations and event source mappings other than Amazon MQ and Amazon DocumentDB.
  • Lambda durable executions can run for up to one year, using checkpoints and replay to recover progress.
  • On replay, completed checkpointed operations use stored results instead of running again; waits suspend execution without compute charges.
  • In November 2026 the default running durable executions quota increased from one million to five million per account, except in N. Virginia, Oregon, and Ireland, where the new quota is twice as high.
  • Lambda assigns CPU capacity in proportion to configured memory.
  • Lambda memory ranges from 128 to 10,240 MB in 1-MB increments, with 128 MB as the default.
  • At 1,769 MB, a Lambda function receives CPU capacity equivalent to one vCPU.
  • Each execution environment has its own temporary /tmp storage, configurable from 512 to 10,240 MB in 1-MB increments.
  • Lambda encrypts /tmp data at rest using an AWS managed key.
  • An Application Load Balancer invokes a Lambda target directly with a JSON representation of the HTTP request.
  • An ALB Lambda response uses JSON fields including statusCode, isBase64Encoded, headers, and body.
  • Lambda initialization runs extension initialization, runtime initialization, and function initialization before invoking the handler.
  • Lambda functions are billed by the number of requests and the duration the code runs, in GB-seconds based on the memory chosen; the free tier includes one million requests and 400,000 GB-seconds per month.
  • A Lambda function URL is a dedicated HTTPS endpoint for one function, with auth type AWS_IAM or NONE (public, still subject to the resource-based policy), and works as a webhook endpoint without API Gateway.
  • Lambda Managed Instances run Lambda functions on EC2 instances defined by a capacity provider with VPC configuration, use EC2 pricing options such as Savings Plans and Reserved Instances, and let one execution environment handle several invocations at once.

Async destinations and dead-letter queues

Asynchronous destinations retain invocationA request to run a function. records so another service can act on a successful or failed execution. A dead-letter queueA target that retains events or messages that could not be processed successfully. (DLQ) retains discarded events for later processing. Think of a destination as an execution report and a DLQ as the event to revisit.

How it works

  1. Choose On success or On failure for the asynchronous destination. Failure includes exhausting attempts or exceeding maximum event age.
  2. Lambda sends a JSON invocation record containing the request and response details to the chosen target.
  3. Alternatively, configure a function DLQ. It receives discarded event content without the function response details included in a destination record.
Target Asynchronous destination Function DLQ
Standard SQS queue Success or failure Discarded events
Standard SNS topic Success or failure Discarded events
Lambda function Success or failure Unsupported
EventBridge event bus Success or failure Unsupported
S3 bucket Failure only Unsupported

Exam cues

  • If the question says retain the response and error details, think on-failure destination, because it includes an invocation record.
  • If the question says start work after a successful asynchronous execution, think on-success destination, because a DLQ only retains discarded events.
  • If the question says SQS-triggered messages need a failure queue, think source-queue redrive policyAn SQS source-queue setting that moves messages to a dead-letter queue after a configured receive count., because the function’s asynchronous settings do not control SQS polling.

Remember

  • Asynchronous destinations can be set on a function, version, or aliasA named Lambda resource that points callers to published versions.. The function DLQ is configured at function level and shared by versions.
  • SQS and SNS targets must be standard. S3 is an on-failure destination only.
  • Reserved concurrencyCapacity dedicated to a function that also limits its simultaneous executions. of 0 sends new asynchronous events to the configured failure destination or DLQ without retries.

Trap: A function DLQ does not capture failed SQS-triggered batchesA group of records passed to a function in one invocation.. Configure the DLQ on the source SQS queue.

Route asynchronous outcomes to separate destinations
12LambdaSuccess targetFailure target
  1. A successful asynchronous execution can emit a record to an on-success destination.

  2. An event that expires or exhausts attempts can emit a record to an on-failure destination.

From the AWS docs (10)
  • An asynchronous destination receives a JSON invocation record containing request and response details.
  • On-success destinations capture successful asynchronous invocations; on-failure destinations capture events that exceed maximum age or exhaust attempts.
  • Asynchronous destinations support standard SQS queues, standard SNS topics, Lambda functions, and EventBridge event buses.
  • An S3 bucket is supported as an asynchronous on-failure destination only.
  • A function dead-letter queue receives discarded asynchronous event content without the function response details in a destination record.
  • A function dead-letter queue can be a standard SQS queue or standard SNS topic; FIFO queues and topics are unsupported.
  • Asynchronous destinations can be configured for a function, version, or alias.
  • The function-level dead-letter queue setting is shared by published versions and $LATEST.
  • SQS-triggered Lambda retries and failure routing use the source queue visibility timeout and redrive policy.
  • For asynchronous invocations, setting reserved concurrency to zero sends new events to the configured DLQ or on-failure destination without retries.

Queue and stream event sources

An event source mappingA Lambda resource that reads queue or stream records and invokes a function with batches. is a Lambda resource that reads a queue or stream and invokes a function with batchesA group of records passed to a function in one invocation. of records. Its retries belong to that source path. At-least-once processing means the same record can be processed again.

How it works

  1. Give the execution roleAn IAM role that Lambda assumes to access other AWS resources. permission to read the source. AWSLambdaSQSQueueExecutionRole and AWSLambdaKinesisExecutionRole provide source permissions; an encrypted SQS queue can also require kms:Decrypt.
  2. For SQS, keep the queue and function in the same Region, including when their accounts differ. Lambda reads messages for a batch; visibility timeoutThe period during which a received queue message is hidden from other consumers. hides received messages while they are being processed.
  3. A failed SQS batch normally makes every message visible again after that timeout. The source queue redrive policyAn SQS source-queue setting that moves messages to a dead-letter queue after a configured receive count. moves repeatedly received messages to its DLQA target that retains events or messages that could not be processed successfully..
  4. For Kinesis, a shardA portion of a stream read and processed by a consumer. is a portion of the stream. By default Lambda processes one batch per shard at a time; an error blocks progress in that shard.
  5. Bound stream failures with MaximumRecordAgeInSeconds and MaximumRetryAttempts. Use BisectBatchOnFunctionError to split failed batches and isolate bad records. A mapping on-failure destination retains discarded-batch information; S3 also retains the full invocationA request to run a function. record.
  6. A batch can be smaller than its configured maximum when messages and their metadata reach the 6 MB synchronous payload limit.

Exam cues

  • If the question says an SQS batch contains fewer records than configured, think the 6 MB payload limit, because message metadata also uses space.
  • If the question says one Kinesis record stalls a shard, think bisection and bounded retries or age, because more capacity alone does not repair the bad record.
  • If the question says a stream consumer stops advancing, think IteratorAge, because it helps detect a stalled consumer.

Remember

  • The function timeout must be no greater than the SQS queue visibility timeout.
  • SQS mapping maximum batch size: 10,000 for standard, 10 for FIFOA processing order that keeps items in the order they were sent.. More than 10 records requires at least a 1-second batching windowThe maximum time a mapping gathers records before invoking a function..
  • Put the DLQ on the SQS source queue. Put stream failure settings and destinations on the event source mapping.
  • Event source mappings: SQS, Kinesis, DynamoDB Streams, Amazon MQ, MSK, DocumentDB change streams.

Trap: A function DLQ and asynchronous retry settings do not control failed SQS messages. Configure the source queue redrive policy and visibility timeout.

An SQS source queue owns failed-message redrive
1234Source SQSLambda batchFailed messagesQueue DLQ
  1. The mapping reads a batch from the source SQS queue and invokes Lambda.

  2. With partial responses enabled, the handler reports failed message IDs.

  3. Failed messages in the source queue become available again after visibility timeout.

  4. The source redrive policy isolates messages that exceed its receive-count threshold in the queue DLQ.

A failed stream batch must be handled before progress resumes
12Kinesis shardLambda batchFailure record
  1. The mapping invokes the function with a shard batch; default errors block shard progress.

  2. Bounded retries or age allow discarding the batch; an on-failure destination retains failure information.

From the AWS docs (15)
  • A Lambda event source mapping reads queue or stream records and invokes a function with a batch.
  • Event source mappings provide at-least-once processing and can repeat records.
  • A Lambda function and its SQS source must be in the same Region but may be in different accounts.
  • The execution role needs source-queue permissions; AWSLambdaSQSQueueExecutionRole supplies queue-reading permissions and an encrypted queue can also require kms:Decrypt.
  • AWSLambdaKinesisExecutionRole supplies permissions for reading Kinesis records through a Lambda event source mapping.
  • Lambda requires function timeout to be no greater than the SQS visibility timeout.
  • SQS visibility timeout and source-queue redrive policy govern retries and dead-letter routing rather than function asynchronous invocation settings.
  • By default, a failed SQS batch makes all messages visible again after visibility timeout, including successfully processed messages.
  • The maximum SQS mapping batch size is 10,000 for standard queues and 10 for FIFO queues; a size over 10 requires a batching window of at least one second.
  • SQS batches must fit the 6 MB synchronous invocation payload quota, including variable-length message metadata, which can reduce the number of records delivered.
  • By default, Lambda processes one batch at a time per Kinesis shard and a function error blocks further progress in that shard.
  • Kinesis mapping MaximumRecordAgeInSeconds and MaximumRetryAttempts bound failed-record processing; BisectBatchOnFunctionError splits failed batches to isolate bad records.
  • A Kinesis mapping on-failure destination can retain discarded-batch information; S3 also retains the full invocation record.
  • IteratorAge helps detect a stalled Lambda stream consumer.
  • Lambda event source mappings poll Amazon SQS, Kinesis, DynamoDB Streams, Amazon MQ, Amazon MSK and Amazon DocumentDB change streams.

Concurrency controls

Lambda concurrencyThe number of function requests being handled at the same time. is the number of requests a function handles at the same time. Reserved concurrencyCapacity dedicated to a function that also limits its simultaneous executions. protects and limits capacity; provisioned concurrencyExecution environments initialized before requests arrive. prepares execution environmentsThe isolated runtime space containing a function and its resources. so requests avoid initialization delays called cold startsThe initialization work needed before an unprepared execution environment can run a request..

How it works

  1. Estimate average concurrency as requests per second multiplied by average duration in seconds. Check the regional quota, because functions share that account capacity.
  2. Reserve concurrency for a function that needs dedicated capacity or a ceiling to protect a database. Other functions cannot borrow the reservation, even when it is unused.
  3. For predictable response latency, allocate provisioned concurrency to a published version or aliasA named Lambda resource that points callers to published versions.. Send requests to that version or alias to use the prepared environments.
  4. Scale provisioned concurrency with Application Auto Scaling using schedules or a target utilization. Requests beyond the prepared capacity can use on-demand environments when capacity remains, so they can still have cold starts.
  5. To stop new processing during a runaway automation, set reserved concurrency to 0. New asynchronous events go to a configured DLQA target that retains events or messages that could not be processed successfully. or on-failure destination without retries.

Exam cues

  • If the question says protect a database from too many simultaneous Lambda calls, think reserved concurrency, because it caps executions.
  • If the question says remove initialization delay for an interactive API, think provisioned concurrency, because it prepares environments before invocationA request to run a function..
  • If the question says prepared capacity must follow office hours, think scheduled scaling, because Application Auto Scaling can change provisioned concurrency on a schedule.

Remember

  • Regional concurrent-execution quota: 1,000 by default, adjustable. New accounts can begin with less.
  • Keep 100 units available for functions without reserved concurrency.
  • Reserved concurrency has no extra charge. Provisioned concurrency costs extra and cannot target $LATEST.
  • Synchronous request rate has a separate ceiling of 10 times the concurrency limit. Do not apply that synchronous ceiling to asynchronous invocationA function invocation that places an event in a Lambda-managed queue for later processing..
  • Concurrency is simultaneous work; request rate is work arriving per second.
  • ConcurrentExecutions in CloudWatch shows how many function instances are processing events; alarm on it to catch runaway scaling.

Trap: Reserving concurrency does not prepare runtimeThe language execution component that runs function code. environments. It cannot by itself remove cold starts.

From the AWS docs (15)
  • Concurrency counts in-flight Lambda requests; average concurrency is average request rate multiplied by average duration in seconds.
  • Reserved concurrency dedicates capacity to a function and caps its simultaneous executions.
  • Configuring reserved concurrency has no additional charge.
  • Provisioned concurrency prepares execution environments ahead of invocation to reduce initialization latency and has additional charges.
  • Provisioned concurrency applies to a published version or alias, not $LATEST; callers must target that version or alias.
  • Application Auto Scaling supports schedules and utilization-based target tracking for provisioned concurrency.
  • The default regional concurrent-execution quota is 1,000 and can be increased; new accounts can start with reduced quotas.
  • Lambda keeps 100 concurrency units available for functions without reserved concurrency.
  • For synchronous invocation, an execution environment serves up to ten requests per second, making the function request-rate limit ten times its concurrency limit.
  • Reserved concurrency of zero stops a function from processing new events.
  • New asynchronous events go to a configured function DLQ or on-failure destination without retries when reserved concurrency is zero.
  • Provisioned concurrency pre-initializes environments; reserved concurrency only reserves capacity and does not perform that initialization.
  • Requests above provisioned capacity can use on-demand capacity when concurrency remains available and can experience cold starts.
  • Each Lambda function can scale by up to 1,000 execution environments every 10 seconds in each Region, and unused scaling capacity does not accrue.
  • Lambda sends metrics such as ConcurrentExecutions, the number of function instances processing events, to CloudWatch every minute, where alarms can respond to changes in utilization.

Versions and aliases

Lambda versions preserve a release while aliasesA named Lambda resource that points callers to published versions. give callers a stable name for a published version. A weighted alias can send part of the traffic to a second version, allowing a canary releaseA release that exposes a new version to only a portion of requests., where only some requests try the new code.

How it works

  1. Package the handlerThe function entry point that processes an invocation event. and its dependencies, then deploy to $LATEST, the editable function version. For Python ZIPs, include compatible dependencies and match native libraries, compiled code loaded by Python, to Lambda’s Linux environment and target processor architecture.
  2. For reusable dependencies, attach a specific layer-version ARNAn identifier for an AWS resource such as a function, version, or alias.. A layerA ZIP archive of supplementary function code or data extracted into /opt. is a ZIP archive of supplementary code or data; Lambda extracts it into /opt. Layer versions are immutable, meaning their contents cannot be edited after publication.
  3. For image packaging, implement the Lambda RuntimeThe language execution component that runs function code. API, the contract used to receive invocationsA request to run a function. and return results. A runtime interface clientA component that implements the Lambda Runtime API for a container image. implements it. AWS Lambda base images include a runtime interface emulatorA tool included in Lambda base images to test invocation handling locally. for local testing. Images must use Linux, target one architecture, and support a read-only filesystem except /tmp. Store the image in Amazon Elastic Container Registry (ECR) in the function’s Region. Changing an existing function between ZIP and image packaging requires a new function.
  4. Set environment variables, literal string pairs available to the code. They are version-specific, encrypted at rest by default with an AWS managed AWS Key Management Service (KMS) key, and can use a customer managed key. AWS recommends Secrets Manager for credentials and API keys.
  5. Publish a numbered version. Code and most configuration, including memory, layers, and environment variables, are fixed for that version. Operational settings such as triggers, destinations, and provisioned concurrencyExecution environments initialized before requests arrive. can still change.
  6. Point an alias to the release. A weighted alias supports two published versions with matching execution roles and DLQA target that retains events or messages that could not be processed successfully. configurations, or no DLQ. Callers must invoke the alias to follow its traffic weights. A REST API stage variable can select the alias suffix in an API Gateway Lambda integration. Configure the target invoke permissions manually when using stage variables.

Exam cues

  • If the question says a gradual release sends all requests to new code, think the caller target, because $LATEST and direct version calls bypass alias weights.
  • If the question says share a fixed dependency release across ZIP functions, think a layer-version ARN, because each layer version preserves its contents.
  • If the question says a custom image runs in Docker but not Lambda, think the Runtime API, because an ordinary container entry point alone does not implement Lambda’s invocation contract.
  • If the question says a published release must retain its environment settings, think version-specific variables, because publishing locks those values.

Remember

  • Weighted alias: at most 2 published versions, never $LATEST. The split is probabilistic, especially noticeable at low traffic.
  • ZIP functions: up to 5 layers. The combined unzipped function, layers, and custom runtime must fit within 250 MB.
  • Environment variables: 4 KB in aggregate. Values are literal strings, not expanded expressions.
  • An unqualified function ARN invokes $LATEST.

Trap: Moving dependencies into layers does not bypass the combined unzipped package limit.

Trap: A published version freezes code and most configuration, not every operational setting associated with the version.

Only alias invocations participate in a weighted release
invoke alias1primary weight2extra weight3CallerAliasStable versionNew version
  1. The caller invokes the alias ARN rather than $LATEST or a version directly.

  2. The alias routes part of the requests to its primary published version.

  3. The remaining configured weight routes to the second published version.

From the AWS docs (26)
  • Deploying code overwrites $LATEST; an unqualified function ARN invokes $LATEST.
  • Publishing creates a numbered snapshot whose code and most configuration, including memory and layers, cannot be edited.
  • Published versions still allow operational changes including triggers, destinations, provisioned concurrency, and asynchronous invocation settings.
  • A weighted Lambda alias routes invocations between at most two published versions of the same function and cannot target $LATEST.
  • Weighted-alias versions must have the same execution role and the same DLQ configuration, or neither may have a DLQ.
  • Weighted alias routing is probabilistic, so low request counts can differ substantially from configured percentages.
  • Traffic weights apply to requests through the alias; a direct version or $LATEST invocation does not traverse that alias.
  • An API Gateway REST API stage variable can select the version or alias suffix of a Lambda integration ARN.
  • Environment variables are literal string pairs in version-specific configuration and are locked when that version is published.
  • All Lambda environment variables together are limited to 4 KB.
  • Lambda encrypts environment variables at rest with an AWS managed KMS key by default; a customer managed key can be configured.
  • AWS recommends Secrets Manager for sensitive values such as database credentials and API keys rather than environment variables.
  • Python ZIP packages must include the handler and compatible dependencies; AWS recommends packaging all dependencies including the SDK to avoid version misalignment.
  • Python native libraries must match the Lambda Linux environment and instruction-set architecture.
  • A Lambda layer is a ZIP archive of supplementary code or data extracted into /opt.
  • Layer versions are immutable and functions reference a specific layer-version ARN.
  • Lambda supports up to five layers for ZIP-based functions; container-image functions include dependencies in the image.
  • The unzipped Lambda deployment package, including layers and custom runtimes, must fit within 250 MB.
  • A Lambda container image must implement the Lambda Runtime API; a runtime interface client implements that contract.
  • AWS Lambda base images include a runtime interface emulator for local testing.
  • Lambda container images must use Linux, target one architecture, and run with a read-only filesystem apart from writable /tmp.
  • The ECR repository for a Lambda container image must be in the same Region as the function, though accounts can differ.
  • Changing an existing Lambda function between ZIP and image packaging requires creating a new function.
  • When a REST API stage variable selects a Lambda function, configure the function invoke permissions manually.
  • Beyond encryption at rest, the Lambda console can turn on helpers for encryption in transit, which encrypt chosen environment variables client-side with a KMS key before they are sent.
  • A .zip deployment package uploaded directly is limited to 50 MB (larger files go through Amazon S3), and a container image can be up to 10 GB uncompressed.

Execution roles and resource policies

A Lambda execution roleAn IAM role that Lambda assumes to access other AWS resources. is an AWS Identity and Access Management (IAM) role that grants the function access to AWS resources. A resource-based policyA policy attached to a resource that grants specified principals access to it. grants callers access to the function. A principalThe identity or service to which a permission statement applies. is the identity or service receiving permission; these policies control different directions of access.

How it works

  1. Set the execution role’s trust policyA role policy that identifies who may assume the role., which states who may assume the role, to trust lambda.amazonaws.com. Lambda assumes that role when invoking the function.
  2. Grant the role the actions the function needs, such as accessing a table or writing logs. AWSLambdaBasicExecutionRole supplies basic CloudWatch Logs permissions.
  3. For an AWS service or another account to invoke the function, add the appropriate function resource-policy grant. Restrict service grants with SourceArn and SourceAccount, the source resource identifier and owning account.
  4. For cross-account invocationA request to run a function., also authorize the caller to invoke the target through its own permissions. An Amazon Resource NameAn identifier for an AWS resource such as a function, version, or alias. (ARN) identifies the function, version, aliasA named Lambda resource that points callers to published versions., or source resource in a policy.
  5. Configure logging destinations and role permissions together. The default log groupA CloudWatch Logs container for related log streams., a container for log streamsA sequence of log events associated with a function execution environment., is /aws/lambda/<function name> and is created on first invocation. Multiple functions can share a custom group; its streams identify function, version, and execution environmentThe isolated runtime space containing a function and its resources.. The role needs logs:PutLogEvents.

For EFS file access using IAM client authorization, EFS evaluates the role’s identity policy and the file-system resource policy together. In the same account, an allow in either can grant access; both do not need matching allows. An applicable explicit deny still overrides an allow. ClientMount permits reading, ClientWrite permits writing, and ClientRootAccess permits root-user access.

Exam cues

  • If the question says Lambda can run but cannot write a table, think execution role, because it controls the function’s AWS resource access.
  • If the question says another account cannot invoke Lambda, think caller permissions plus function resource policy, because cross-account access needs both sides.
  • If the question says collect several functions’ logs in one group, think a shared custom logging configuration and role permissions, because log streams retain function identity.

Remember

  • Role trust: lambda.amazonaws.com.
  • Code access: execution role. Caller access: resource policy, with caller permissions also required for cross-account invocation.
  • Logs need logs:PutLogEvents; changing the log-group name does not itself grant that permission.
  • EFS IAM authorization combines identity and file-system policies.
  • S3 notifications need the function’s resource-based policy to allow S3 to invoke it.

Trap: Giving the execution role permission to write to a service does not grant that service permission to invoke the function.

Invocation permission and execution permission have different owners
resource policy1execution role2EventBridgeLambdaDynamoDB
  1. The function resource policy permits the source service to invoke Lambda.

  2. Lambda assumes its execution role to access the downstream resource.

From the AWS docs (15)
  • Lambda assumes the function execution role to access other AWS resources.
  • An execution-role trust policy must trust the service principal lambda.amazonaws.com.
  • A Lambda resource-based policy grants principals such as AWS services and other accounts access to a function, version, or alias.
  • Cross-account invocation requires a grant in the function resource policy and corresponding Lambda API permission for the caller.
  • SourceArn and SourceAccount conditions can restrict service invocation permissions to the intended source resource and account.
  • AWSLambdaBasicExecutionRole grants basic CloudWatch Logs permissions.
  • The default CloudWatch log group is /aws/lambda/<function name>, created on first invocation.
  • Multiple Lambda functions can send logs to the same custom log group; custom streams identify function, version, and execution environment.
  • The execution role needs logs:PutLogEvents to send function logs to CloudWatch Logs.
  • For EFS IAM client authorization, EFS evaluates the file-system resource policy together with the client identity policy.
  • EFS ClientMount grants read access, ClientWrite grants write access, and ClientRootAccess grants root-user access.
  • For same-account EFS IAM client authorization, an allow in either identity or file-system policy can grant an action; an allow in both is not required.
  • An explicit deny in an applicable IAM identity or resource policy overrides an allow.
  • RDS for PostgreSQL can invoke Lambda functions through the aws_lambda extension once the instance has an outbound network path to Lambda and an IAM role allowed to invoke the function.
  • For S3 event notifications, the bucket is configured to send events and the function's resource-based policy grants Amazon S3 permission to invoke it.

VPC connectivity

A Lambda VPC attachment lets function code reach resources in your private network. Lambda still runs in its own managed VPC and uses Hyperplane elastic network interfaces (ENIs), managed network connections into your selected subnets and security groups.

How it works

  1. Select the customer VPC subnets and security groups, rules that control allowed network traffic. Give the execution roleAn IAM role that Lambda assumes to access other AWS resources. the interface-management permissions supplied by AWSLambdaVPCAccessExecutionRole to establish the attachment.
  2. Lambda uses a Hyperplane ENIA Lambda-managed network interface connecting a function to customer VPC resources. for the attachment. Interface-management permissions establish connectivity; they do not authorize each function invocationA request to run a function..
  3. For IPv4 internet access, route private-subnet traffic through a NAT gatewayA network component that translates private addresses for outbound IPv4 connections. in a public subnet, then through an internet gateway. A NAT gateway translates the private source address so replies can return. Selecting a public subnet alone gives the function neither a public IP nor internet access.
  4. For S3 access, an S3 gateway endpoint provides a VPC path to the service. For IPv6 internet access, enable outbound IPv6, use dual-stack subnets that support both IPv4 and IPv6, and configure the IPv6 route through an egress-only internet gateway.
  5. For shared persistent files, mount EFS through an access pointAn EFS entry point that supplies a file-system path and access settings for a client., a configured entry path into the file system, under /mnt/. Make a mount targetA network endpoint through which a client reaches an EFS file system., the network endpoint for the file system, available in each function Availability Zone. Allow Network File System (NFS) traffic on port 2049 between the function and mount-target security groups.
  6. Give the function EFS permissions, including ClientMount and ClientWrite when writing under a user-configured EFS IAM policy. Cross-account EFS also needs VPC routing or peering, a private connection between VPCs, so the function can reach the mount targets.

Exam cues

  • If the question says Lambda lost IPv4 internet access after VPC attachment, think private-subnet NAT routing, because attachment does not assign a public IP.
  • If the question says the VPC attachment fails with network interface errors, think available subnet IP addresses and the VPC interface quota, because either can limit connectivity.
  • If the question says files must be shared across Lambda environments, think EFS access points, because they expose shared files through a local mount.
  • If the question says cross-account EFS has IAM permissions but times out, think routing and NFS rules, because authorization does not provide network connectivity.

Remember

  • Public subnet placement alone does not provide Lambda internet access.
  • Outbound IPv6 is off by default; every selected subnet must be dual stackA network configuration that supports both IPv4 and IPv6. when enabling it.
  • EFS NFS traffic: port 2049. Lambda mount path: begins with /mnt/.
  • An EFS access point can restrict the accessible file-system path.

Trap: A NAT gateway is the IPv4 internet solution described here. IPv6 can use its own egress-only internet gateway path; an S3 endpoint provides a service path rather than general internet access.

IPv4 internet access uses a private-to-public route
private route1internet gateway2Lambda VPC linkVPC egresspublic-subnet NATInternet
  1. The function VPC attachment uses a private-subnet route to a NAT gateway in a public subnet.

  2. The public subnet routes through an internet gateway for IPv4 internet access.

Cross-account EFS needs a network path and file permissions
Function account VPCFile-system account VPCrouted NFS1LambdaEFS mount
  1. Use routed VPC connectivity, allow NFS port 2049, and authorize the Lambda client to mount EFS through an access point.

From the AWS docs (16)
  • Lambda functions run in a Lambda-managed VPC; a customer VPC attachment provides access to customer VPC resources.
  • Connecting Lambda to a public subnet does not give the function a public IP address or internet access.
  • A VPC-connected Lambda function can reach the IPv4 internet from private subnets through a NAT gateway in a public subnet with internet-gateway routing.
  • An S3 gateway endpoint provides an alternative path from the VPC to S3.
  • Outbound IPv6 support is disabled by default and requires all selected Lambda subnets to be dual stack.
  • An egress-only internet gateway provides an outbound internet route for IPv6 in the Lambda VPC internet-access setup.
  • AWSLambdaVPCAccessExecutionRole grants the execution role permissions to create and manage the network interfaces used for a VPC attachment.
  • Network-interface management permissions are needed to create the VPC attachment, not for each subsequent function invocation.
  • Lambda can mount shared EFS files through an access point to a local directory beginning with /mnt/.
  • EFS mount targets must be reachable from the Lambda subnets, with NFS traffic on port 2049 allowed by function and mount-target security groups.
  • Create EFS mount targets in every Availability Zone used by the Lambda function.
  • With a user-configured EFS IAM policy, Lambda needs ClientMount and, for writes, ClientWrite permissions plus VPC connectivity permissions.
  • Cross-account Lambda access to EFS requires network visibility through VPC routing or peering and IAM permissions to mount the file system.
  • An EFS access point can limit a Lambda client to a specific file-system path.
  • Network connectivity errors for a VPC-connected function can come from running out of IP addresses or network interfaces; ENILimitReachedException means the VPC hit its network interface quota (3,000 per VPC by default).
  • By default a Lambda function can reach the public internet; once attached to a VPC it reaches only what that VPC can reach, so internet access then needs a VPC path such as a NAT gateway.

Memory, timeout and SnapStart

Lambda sizing has one main dial: memory, which also sets CPU. Timeout caps how long a run can take, and SnapStart cuts cold startsThe initialization work needed before an unprepared execution environment can run a request. for supported runtimes.

How it works

  1. Set memory between 128 MB and 10,240 MB; CPU grows with it.
  2. Set a timeout up to 30 minutes; a run that exceeds it is stopped.
  3. For Java, Python or .NET, enable SnapStart on published versions: Lambda initializes once and resumes later cold starts from a snapshot.

Exam cues

  • If the question says a Lambda function is slow or CPU-bound, think more memory.
  • If the question says a task runs longer than the Lambda maximum, think BatchA group of records passed to a function in one invocation., ECS or Fargate, or Step Functions instead of one Lambda invocationA request to run a function.. The maximum is 30 minutes since November 2026; earlier questions use 15 minutes.
  • If the question says cold starts for Java functions, think SnapStart (or provisioned concurrencyExecution environments initialized before requests arrive.).

Remember

  • Memory 128 MB to 10,240 MB; CPU proportional.
  • Timeout default 3 seconds, maximum 1,800 seconds (was 900 seconds until November 2026).
  • SnapStart: Java 11+, Python 3.12+, .NET 8+.
  • Cold start: new environment, code download, initialization. Environment reuse is possible, never guaranteed.

Trap: Lambda has no separate CPU setting. To get more CPU, raise memory.

From the AWS docs (8)
  • A Lambda function's memory can be set from 128 MB (the default) to 10,240 MB in 1 MB steps.
  • Lambda allocates CPU power in proportion to configured memory, so memory is the main lever for function performance.
  • A Lambda function's timeout defaults to 3 seconds and can be set in 1-second steps up to 1,800 seconds (30 minutes).
  • In November 2026 the Lambda documentation raised the maximum function timeout from 900 seconds (15 minutes) to 1,800 seconds (30 minutes).
  • Lambda SnapStart cuts cold start latency, often to under a second, by initializing the function when you publish a version and resuming later invocations from a cached snapshot.
  • SnapStart supports Java 11 and later, Python 3.12 and later, and .NET 8 and later managed runtimes.
  • Lambda /tmp ephemeral storage is configurable from 512 MB to 10,240 MB, is unique to each execution environment and is encrypted at rest.
  • A cold start happens when Lambda prepares a new execution environment by downloading code, starting the environment and running initialization code; Lambda may reuse an environment for later invocations, but reuse is not guaranteed.

Idempotent automation

IdempotentThe property that repeating the same operation causes no additional side effects. automation can process the same request repeatedly without creating extra business effects. Lambda retries and duplicate delivery make this necessary: a repeated event must not create an extra order or repeat a completed update.

How it works

  1. Validate the event and choose a stable idempotency keyA stable identifier used to recognize repeated attempts at the same business operation., an identifier for the intended business operation. Do not let changing timestamps or random input fields create a new key for the same operation.
  2. Store the key in persistent storage such as DynamoDB. Acquire a lock before processing so two invocationsA request to run a function. cannot both treat the operation as new. Powertools for AWS Lambda provides an idempotency utility that handles persistent results, concurrent attempts, and in-progress expiration.
  3. Perform the operation and save its completed result. A duplicate can return that result. A DynamoDB conditional writeA database change performed only when its specified condition matches., an update performed only when a condition matches, can make a state change safe to repeat when the condition checks the attribute being changed.
  4. Account for failure after a side effect but before the completed result is saved. A lock or completed-event table alone does not make every external action safe to repeat.
  5. Initialize software development kitA language library used by code to call service APIs. (SDK) clients and database connections outside the handlerThe function entry point that processes an invocation event.. Reused environments can reuse them and static files in /tmp; keep durable idempotency state in persistent storage and avoid retaining user or security-sensitive data locally.
  6. When Lambda implements a CodePipeline action, call PutJobSuccessResult or PutJobFailureResult to report the job result. Do not log the full event, which can contain temporary artifact credentials.

Exam cues

  • If the question says a retried Lambda event repeats a completed update, think stable idempotency keys and persistent results, because delivery can repeat.
  • If the question says simultaneous duplicates pass the completed-event check, think an early idempotency lock, because both requests can observe an absent record.
  • If the question says SDK setup repeats on every invocation, think initialization outside the handler, because reused environments retain reusable clients.
  • If the question says a successful Lambda action leaves CodePipeline waiting, think explicit job-result reporting, because returning from the handler does not report the pipeline job result.

Remember

  • Idempotency describes the business effect, not whether the handler executes again.
  • Cache reuse is limited to the execution environmentThe isolated runtime space containing a function and its resources. that holds the cache.
  • A result saved after an external side effect leaves a failure window that must be handled.

Trap: Disabling retries does not establish idempotency. Duplicate input still needs a stable identity and durable handling.

Claim an operation before doing work and saving its result
claim1process2complete3LambdaClaim keyBusiness actionSave result
  1. Use the stable operation key to acquire a persistent lock before processing.

  2. Perform the business action only after claiming the operation.

  3. Save the completed result so a duplicate can return it; handle failure between the action and this save.

From the AWS docs (13)
  • An idempotent operation produces no extra side effects when repeated with the same input.
  • Lambda functions must handle duplicate events safely and validate events.
  • An idempotency key identifies a business operation using stable input fields; changing timestamps or random fields can defeat deduplication.
  • Idempotency can store a key and result in durable storage such as DynamoDB and return the existing result for a duplicate.
  • An idempotency lock acquired before processing prevents concurrent invocations from both treating the same operation as new.
  • If an operation succeeds before idempotency state is saved and the invocation then fails, a retry can repeat the side effect.
  • DynamoDB conditional writes can make updates idempotent when the condition checks the attribute being updated.
  • Initialize SDK clients and database connections outside the Lambda handler so reused execution environments can reuse them.
  • Static assets cached in /tmp can be reused by subsequent invocations in the same environment.
  • AWS recommends not storing user data, events, or security-sensitive information in a reused Lambda execution environment.
  • A CodePipeline Lambda action reports its job result using PutJobSuccessResult or PutJobFailureResult.
  • A CodePipeline Lambda event can contain temporary artifact credentials and must not be logged in full.
  • Powertools for AWS Lambda provides an idempotency utility with persistent results, concurrency handling, and expiration of in-progress executions.

Operational controls and failure handling

Lambda operational settings control how asynchronous errors are retried, how failed records are delivered, and how queue and stream consumers handle batchesA group of records passed to a function in one invocation.. These controls also help diagnose delivery, networking, and integration issues.

How it works

  1. For asynchronous function errors, set MaximumRetryAttempts from 0 to 2. MaximumEventAgeInSeconds limits queue age to at most six hours. Throttles and system errors follow a separate retry path with exponential backoffAn increasing delay between retry attempts..
  2. If a destination receives no invocationA request to run a function. records, check DestinationDeliveryFailures and the execution roleAn IAM role that Lambda assumes to access other AWS resources. permissions. Delivery can fail because of permissions, record size, or an unsupported target.
  3. An S3 destination is available for failures, including large records that exceed the SNS message limit. Its execution role needs s3:PutObject and s3:ListBucket; a KMS-encrypted bucket also needs kms:GenerateDataKey.
  4. For SQS partial batch responses, enable ReportBatchItemFailures in FunctionResponseTypes and return failed message IDs as itemIdentifier entries in batchItemFailures. For FIFOA processing order that keeps items in the order they were sent. (first-in, first-out), stop at the first failure and return failed and unprocessed messages. Throwing an exception fails the entire batch. With this setting enabled, Lambda does not scale down polling when function invocations fail.
  5. Set the SQS visibility timeoutThe period during which a received queue message is hidden from other consumers. to at least six times the function timeout plus MaximumBatchingWindowInSeconds, as AWS recommends. For Kinesis, ParallelizationFactor increases concurrent batches per shardA portion of a stream read and processed by a consumer. while preserving partition-key order.
  6. For an Application Load Balancer (ALB) Lambda target, enable multi-value headers to preserve repeated headers and query parameters as arrays. The response must then use multiValueHeaders.
  7. An external extensionA component that runs with a function to provide capabilities such as monitoring. runs as a separate process in the execution environmentThe isolated runtime space containing a function and its resources.; an internal extension runs inside the runtimeThe language execution component that runs function code. process. Lambda can also share Hyperplane network interfaces between functions in the same account that use the same subnet and security-group combination.

Exam cues

  • If the question says events still wait after function-error retries are disabled, think throttlingRejection of requests because a capacity or request-rate limit has been reached. or system errors, because they use a separate retry path.
  • If the question says a destination stopped receiving records after a permissions change, think DestinationDeliveryFailures and the execution role, because delivery can fail independently.
  • If the question says successful SQS messages are retried with failed ones, think partial batch responses, because the handlerThe function entry point that processes an invocation event. can report failed IDs.
  • If the question says a Kinesis consumer needs more concurrent batches per shard while retaining partition-key order, think ParallelizationFactor, because it controls that concurrencyThe number of function requests being handled at the same time..
  • If the question says an ALB loses repeated query parameters, think multi-value headers, because the setting preserves them as arrays.
  • If the question says functions in one account use the same subnet and security groups, think Hyperplane interface reuse, because they can share an interface.

Remember

  • Asynchronous throttles and system errors retry for up to six hours by default, with backoff from one second to five minutes.
  • SNS destination messages have a 256 KB default limit; S3 is an asynchronous on-failure destination only.
  • SQS visibility timeout recommendation: at least 6 × function timeout + batching window.
  • Kinesis ParallelizationFactor: 1 by default, up to 10 concurrent batches per shard.

Trap: Setting MaximumRetryAttempts to 0 stops function-error retries, but does not disable the separate retry path for asynchronous throttles and system errors. An SQS handler that throws an exception also fails the whole batch, even with partial responses enabled.

From the AWS docs (17)
  • DestinationDeliveryFailures reports failed delivery of invocation records, including permission, size, and unsupported-target errors.
  • The function execution role needs permission to deliver to its destination, such as sqs:SendMessage or sns:Publish.
  • SNS destination messages are limited to 256 KB by default, so an invocation record containing a large asynchronous payload can fail delivery.
  • An S3 bucket is supported as an asynchronous on-failure destination only.
  • An S3 failure destination needs s3:PutObject and s3:ListBucket on the execution role; a bucket encrypted with a KMS key also requires kms:GenerateDataKey.
  • MaximumRetryAttempts controls asynchronous function-error retries and accepts 0 through 2.
  • Lambda retries asynchronous throttles and system errors for up to six hours by default, with exponential backoff from one second to five minutes.
  • MaximumEventAgeInSeconds limits time in the asynchronous queue to at most six hours.
  • Enabling lambda.multi_value_headers.enabled on the ALB target group preserves repeated headers and query parameters as arrays; responses must then use multiValueHeaders.
  • An external Lambda extension is a separate process in the execution environment; an internal extension runs within the runtime process.
  • Enable ReportBatchItemFailures in FunctionResponseTypes and return failed SQS message IDs as itemIdentifier entries in batchItemFailures to retry only failed messages.
  • For SQS FIFO partial responses, stop after the first failure and return failed and unprocessed messages to preserve order.
  • AWS recommends SQS visibility timeout of at least six times the function timeout plus MaximumBatchingWindowInSeconds.
  • Throwing an exception from a Lambda SQS handler makes the entire batch fail even when partial responses are enabled.
  • ParallelizationFactor can increase concurrent batches per Kinesis shard from the default 1 to 10, while preserving partition-key ordering.
  • With ReportBatchItemFailures enabled, Lambda does not scale down SQS message polling when function invocations fail.
  • Lambda shares Hyperplane network interfaces among functions in the same account that use the same subnet and security-group combination.

Flashcards

tap to flip
Answer

·

All 78 cards as a list

A small piece of code must run each time a file lands in an S3 bucket, with no servers to manage. Which service fits?

AWS Lambda, triggered by the S3 event.

Who patches and scales the servers that run AWS Lambda functions?

AWS. Lambda is serverless; you supply only the code.

A company wants to run code in response to new uploads to an Amazon S3 bucket, with no servers to manage. Which service fits?

AWS Lambda, triggered by S3 events.

AWS manages the servers, capacity and scaling.

Who patches and scales the servers that run AWS Lambda functions?

AWS. Lambda is serverless; you manage only your code.

What are the default timeout and normal maximum timeout for a Lambda function?

Three seconds by default; normally up to 1,800 seconds (30 minutes), raised from 900 seconds in November 2026. Lambda Managed Instances have a longer allowance for qualifying asynchronous and event source mapping invocations.

Who retries synchronous Lambda function errors, and what happens after an asynchronous function error?

The synchronous caller decides whether to retry. For asynchronous invocation, Lambda retries function errors twice by default, after waits of one minute and then two minutes. MaximumRetryAttempts can be 0 through 2.

A CPU-bound Lambda function has enough memory but runs too slowly. Which resource setting should the team test increasing?

Memory. Lambda increases CPU capacity in proportion to memory; 1,769 MB provides the equivalent of one vCPU.

A Lambda function needs more local scratch space for a downloaded object. What storage can it configure?

Increase ephemeral /tmp storage, from 512 to 10,240 MB. It belongs to one execution environment and is encrypted at rest.

A Lambda workflow must wait for human approval for days and recover progress after interruptions. Which Lambda feature fits?

Use a durable function with checkpointed steps and waits. A durable execution can last up to one year; replay uses stored results for completed checkpoints.

An application sends events to AWS Lambda asynchronously and cannot wait for processing to finish. How does Lambda receive the work?

Lambda places the events in a managed internal queue for asynchronous invocation.

An AWS Lambda function processes asynchronous events. Can it receive the same event more than once after successful processing?

Yes. Asynchronous invocation can deliver duplicate events even when the function succeeds.

A third-party service must call a Lambda function through an HTTPS webhook. What is the simplest option?

A Lambda function URL: a dedicated HTTPS endpoint for the function, with no API Gateway to set up.

A steady, high-volume AWS Lambda workload should use EC2 Savings Plans and specialized instance types without managing servers. Which Lambda option fits, and how does its concurrency differ?

Lambda Managed Instances. Functions run on EC2 instances from a capacity provider, and one execution environment can handle several invocations at once.

A team must retain asynchronous Lambda events that expire or exhaust retries. What should it configure?

Configure an on-failure destination or a function dead-letter queue. The destination includes request and response details; a DLQ retains the event without those response details.

How do asynchronous Lambda destinations and a function DLQ differ?

Destinations can capture success or failure records and support standard SQS, standard SNS, Lambda, and EventBridge; S3 is failure-only. A function DLQ handles discarded events through standard SQS or standard SNS without the destination response record.

A team wants a record of successful asynchronous Lambda executions. Can it use the function DLQ?

Use an on-success destination. A function DLQ handles discarded events, not successful invocations.

Can an asynchronous Lambda destination send failed execution records to an SQS FIFO queue?

No. The SQS destination must be a standard queue. FIFO is also unsupported for a function DLQ.

A Lambda function consuming Kinesis repeatedly fails on one bad record with default processing settings. What happens to its shard?

Progress in the affected shard stops while Lambda retries the failed batch. Use mapping retry/age limits and batch bisection to isolate or discard bad records; an on-failure destination can retain discarded-batch information.

Does the asynchronous retry setting or function DLQ control failed SQS-triggered Lambda messages?

No. Configure the SQS source queue visibility timeout and redrive policy with its DLQ. The event source mapping uses source-queue retry behavior.

A Lambda event source mapping cannot read its Kinesis stream. Where should the team check permissions?

Check the function execution role for source-read permissions. AWSLambdaKinesisExecutionRole provides the relevant Kinesis permissions.

A Lambda SQS source uses an encrypted queue. What additional execution-role permission can be needed beyond queue access?

kms:Decrypt for the queue encryption key.

An SQS event source mapping for Lambda has a large configured batch size but sends fewer messages per invocation. What size limit can explain this?

The 6 MB synchronous invocation payload limit includes message metadata. A batch can contain fewer messages than the configured maximum.

A team wants AWS Lambda to process messages from an Amazon MQ broker without writing a poller. Is that supported?

Yes. An event source mapping can poll Amazon MQ, as it does SQS, Kinesis, DynamoDB Streams, MSK and DocumentDB change streams.

How do reserved concurrency and provisioned concurrency differ for Lambda?

Reserved concurrency dedicates capacity and caps a function at no extra charge. Provisioned concurrency prepares environments for a published version or alias and costs extra. Reserved capacity alone does not pre-initialize environments.

A Lambda automation floods a database. How can the team stop new executions, and what happens to new asynchronous events?

Set reserved concurrency to 0. The function stops processing new events; new asynchronous events go to the configured DLQ or on-failure destination without retries.

What are the default Lambda concurrency quota and unreserved capacity requirement?

The default is 1,000 concurrent executions per Region, with 100 units kept for functions without reserved concurrency. New accounts can start lower; quota increases are possible.

A Lambda API has latency spikes after idle periods. The team already reserved concurrency. What should it configure?

Provisioned concurrency on the published version or alias that clients invoke. Reserved concurrency does not pre-initialize environments.

A Lambda API has a predictable daily traffic peak. How can its prepared capacity follow that schedule?

Use Application Auto Scaling scheduled scaling for provisioned concurrency. Use target tracking when capacity should follow utilization.

A Lambda function exceeds its provisioned concurrency but has unused concurrency capacity. Are all additional requests necessarily throttled?

No. They can use on-demand execution environments and may experience cold starts. Provisioned concurrency alone is not the function concurrency cap.

How fast can one Lambda function add concurrency during a sudden burst?

Up to 1,000 more execution environments every 10 seconds per function per Region, within the account concurrency quota.

An AWS Lambda function can scale out quickly and overwhelm a downstream database. How can the team be warned before concurrency gets too high?

Create an Amazon CloudWatch alarm on the Lambda ConcurrentExecutions metric (or Invocations) with the expected threshold.

Lambda publishes these metrics to CloudWatch every minute.

Which Lambda version settings are fixed after publication, and what can a weighted alias target?

Published code and most configuration are fixed; operational settings such as triggers and destinations can still change. A weighted alias routes between at most two published versions, never $LATEST.

A gradual Lambda release uses a weighted alias, but callers always execute the newly deployed $LATEST code. What should change?

Make callers invoke the alias. Calls to $LATEST or a version directly bypass the alias traffic weights.

An API Gateway REST API stage invokes Lambda $LATEST during a weighted-alias release. How can it follow that release?

Configure the Lambda integration to invoke the alias, for example by using a stage variable for the alias suffix. Only requests through that alias follow its weights. Configure the target invoke permissions explicitly when using stage variables.

A Lambda team wants every low-traffic sample to match the weighted alias percentage exactly. Does alias routing guarantee that?

No. Routing is probabilistic; small request samples can differ substantially from the configured split.

A team wants to send a small portion of Lambda traffic to a new release during a canary deployment. What should it configure?

Publish both versions and configure a weighted alias to route invocations between them.

A Lambda canary uses a weighted alias, but some callers invoke a version ARN directly. Are those calls included in the traffic split?

No. Only calls through the alias use its traffic weights.

A Lambda weighted alias cannot route traffic to a newly published version. Which execution settings must match between the two versions?

They must use the same execution role and the same dead-letter queue configuration, or neither can have a dead-letter queue.

A team changes Lambda environment variables after publishing a release. Will existing published versions get those new values?

No. Environment variables are version-specific and locked on publication. Publish a new version and move the alias to adopt the new configuration.

What encryption and secret-storage choices apply to Lambda environment variables?

Lambda encrypts them at rest using an AWS managed KMS key by default; a customer managed key is optional. AWS recommends Secrets Manager for credentials and API keys.

Lambda environment variables hold third-party API keys that must also be protected in transit, not only at rest. What does Lambda offer?

Console helpers for encryption in transit: they encrypt the chosen variables client-side with a KMS key, and the function decrypts them at runtime.

A Lambda canary receives few requests, and the observed traffic split differs from the alias weights. Why?

Weighted alias routing is probabilistic, so low request counts can differ substantially from the configured percentages.

What is the difference between a Lambda execution role and a function resource-based policy?

The execution role grants the function access to other AWS resources. A resource-based policy grants callers such as AWS services or other accounts access to the function. The role trust policy lets Lambda assume the role.

A Lambda function runs but receives AccessDenied when writing to DynamoDB. Which permission should the team inspect?

Inspect the function execution role permissions for DynamoDB. Invocation permission in the function resource policy does not grant access to the resources the code uses.

A role in another account has lambda:InvokeFunction, but invoking the shared Lambda function is denied. What other permission is required?

The target function resource policy must allow that caller or account. Cross-account invocation needs the caller permission and the target-side grant.

An AWS Lambda function needs permission to write logs to Amazon CloudWatch Logs. Which identity needs that permission?

The Lambda function execution role. AWSLambdaBasicExecutionRole grants basic CloudWatch Logs permissions.

A same-account Lambda client uses IAM authorization for EFS. Must both its role policy and the EFS file-system policy contain an allow for every action?

No. EFS evaluates the policies together; an allow in either can grant an action. ClientMount grants read access, while ClientWrite grants write access. An applicable explicit deny still overrides an allow.

An application in one AWS account must invoke a Lambda function in another account. Which permissions are required?

Grant access in the function resource-based policy and give the caller corresponding Lambda API permission.

An S3 bucket must invoke an AWS Lambda function on each upload. Which permission lets S3 call the function?

A statement in the function's resource-based policy allowing Amazon S3 to invoke it. The execution role only needs S3 read access if the function reads the object.

Does placing a VPC-connected Lambda function in a public subnet give it IPv4 internet access?

No. It does not receive a public IP. Use private-subnet routing through a NAT gateway in a public subnet for IPv4 internet access; an S3 gateway endpoint can provide a separate S3 path.

A team cannot attach a Lambda function to a VPC because network-interface creation is denied. What role permission should it inspect?

Check the execution role network-interface management permissions, supplied by AWSLambdaVPCAccessExecutionRole. Those permissions establish the attachment, rather than authorizing every invocation.

Multiple Lambda environments need access to the same persistent files. What should the team configure?

Mount EFS through an access point under /mnt/. Provide mount targets in the function Availability Zones, allow NFS port 2049, and configure the required IAM permissions.

A Lambda function can mount local EFS but cannot mount EFS in another account after an IAM grant. What else must the team establish?

Provide routed VPC connectivity, such as peering, to the EFS mount targets and allow NFS traffic. IAM permission alone does not establish the network path.

Can a VPC-connected Lambda function use outbound IPv6 without an IPv4 NAT gateway?

Yes, with outbound IPv6 enabled, dual-stack selected subnets, and the appropriate IPv6 internet route, such as an egress-only internet gateway. IPv4 NAT is not the only internet-access path.

A VPC-connected Lambda function in a small /27 subnet starts failing with network interface errors as load grows. What are likely causes?

The subnet ran out of free IP addresses, or the VPC reached its network interface quota (ENILimitReachedException). Use larger subnets or raise the quota.

A Lambda function calls a public API successfully, but after it is attached to private subnets to reach RDS, the API calls time out. Why?

Attached to a VPC, the function reaches only what the VPC can reach. Give the private subnets a route to a NAT gateway for internet access.

A CPU-bound Lambda function at 512 MB runs slowly, and its memory use is low. Which setting speeds it up?

Raise the function's memory: Lambda gives CPU in proportion to memory (128 MB to 10,240 MB).

A batch job takes about 45 minutes per run. Can it run as one AWS Lambda invocation?

No. The Lambda timeout maximum is 1,800 seconds (30 minutes); use AWS Batch, ECS or Fargate, or split the work with Step Functions. Questions written before November 2026 use the old 15-minute limit.

A Java Lambda function behind API Gateway has multi-second cold starts. Which Lambda feature reduces them without paying for idle capacity?

Lambda SnapStart, which resumes from a snapshot taken when the version is published (provisioned concurrency also works, at a cost).

What are the default and maximum timeout for an AWS Lambda function?

Default 3 seconds; maximum 1,800 seconds (30 minutes), raised from 900 seconds in November 2026.

A containerized Lambda function needs 5 GB of scratch space during each run. Does it need EFS?

No. Set the function ephemeral storage (/tmp) to at least 5 GB; it goes up to 10,240 MB. EFS is for data that must persist or be shared.

An AWS Lambda function caches data in a global variable. Can every invocation rely on that cache?

No. A reused execution environment keeps it, but a cold start creates a new environment without it.

How should a Lambda automation prevent duplicate events from repeating a business operation?

Use a stable idempotency key and persistent state, such as DynamoDB, to recognize completed operations. Protect concurrent attempts with a lock; make individual side effects safe to retry.

Two Lambda invocations receive the same business event at nearly the same time. Why is checking a completed-event table insufficient by itself?

Both can see no completed record before either writes it. Acquire an idempotency lock before processing, or use an idempotency utility that handles concurrent attempts.

A Lambda function repeatedly creates SDK clients and database connections. How can it reduce repeated setup?

Initialize clients and connections outside the handler so invocations in a reused execution environment can reuse them.

A Lambda automation keeps processed-event IDs only in memory or /tmp. Is that a reliable duplicate-processing guard?

No. Local reuse applies only within the same execution environment. Store idempotency state in persistent storage such as DynamoDB.

A Lambda action returns normally, but its CodePipeline action does not complete. What must the handler report?

Call PutJobSuccessResult or PutJobFailureResult for the job. Do not log the entire event because it can include temporary artifact credentials.

A Lambda on-failure destination receives no records after its permissions change. What should the team inspect?

Inspect DestinationDeliveryFailures and the function execution role permission to send to the target. Destination delivery itself can fail.

Large asynchronous Lambda failure records exceed the SNS destination message limit. Which destination can retain them, and what permissions does it need?

Use an S3 on-failure destination. Grant the execution role s3:PutObject and s3:ListBucket; a KMS-encrypted bucket also needs kms:GenerateDataKey.

A Lambda function has MaximumRetryAttempts set to 0, but asynchronous events still wait during throttling. Why?

The setting controls function-error retries. Throttles and system errors use a separate retry path, bounded by event age, with a six-hour default.

An ALB invokes a Lambda function, but repeated query parameters are lost. What should the team enable?

Enable lambda.multi_value_headers.enabled on the target group. The request uses arrays for repeated values, and the function must use multiValueHeaders in its response.

How do internal and external Lambda extensions differ?

An internal extension runs inside the runtime process. An external extension runs as a separate process in the same execution environment.

A Lambda SQS consumer reprocesses successful messages after one message fails. What settings and response should it use?

Enable ReportBatchItemFailures and return failed message IDs in batchItemFailures. For FIFO, stop at the first failure and also return unprocessed messages. AWS recommends visibility timeout of at least six times function timeout plus the batching window.

A Lambda consumer retries an entire SQS batch after one record fails. How can it avoid retrying successful records?

Enable ReportBatchItemFailures in the mapping FunctionResponseTypes and return failed message IDs as itemIdentifier entries in batchItemFailures.

A Lambda SQS consumer enables ReportBatchItemFailures but throws an exception after processing part of the batch. What is retried?

The entire batch fails. Catch item-level errors and return a partial response with failed message IDs to preserve successful results.

A Lambda Kinesis consumer needs more parallel work per shard while retaining partition-key order. What setting applies?

ParallelizationFactor, from 1 by default through 10 concurrent batches per shard.

An SQS queue feeds Lambda and some messages routinely fail. How can the team avoid retrying successful messages without reducing polling on failures?

Enable ReportBatchItemFailures and return failed message IDs. Lambda does not scale down polling on function failures with that setting enabled.

Several Lambda functions use the same subnet and security groups. Does Lambda need a separate network interface for every function?

No. Functions in the same account can share a Hyperplane ENI for the same subnet and security-group combination.

You finished every topic of DOP-C02!

Your badge turned gold. Next step: book the exam on AWS. Once you pass, add yourself to Who passed.

Share

Share that you finished this certification

I finished every topic of AWS Certified DevOps Engineer - Professional (DOP-C02) on Easy Review. Come study too!