Easy ReviewSAA-C03
Design Secure Architectures51

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.

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.

Flashcards

tap to flip
Answer

·

All 51 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.

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.

You finished every topic of SAA-C03!

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 Solutions Architect - Associate (SAA-C03) on Easy Review. Come study too!