Bitzu

SAA-C03 ยท Decoupling and serverless patterns

AWS Lambda for event-driven workloads

Lambda triggers (S3, SQS, API Gateway, EventBridge), the 15-minute timeout, stateless execution and when a workload does not fit Lambda.

Key points

  • Lambda runs your function on events: S3 object, SQS messages (Lambda polls), API Gateway request, EventBridge rule.
  • Limit: 900 seconds (15 minutes) per invocation.
  • Memory: 128 to 10,240 MB; CPU scales in proportion.
  • Stateless: durable state goes to S3, DynamoDB or a cache.
  • Multi-hour jobs, always-on servers, apps needing local state between requests fit containers or EC2 better.

Source: https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html

Practice questions

Single choice

What is the maximum timeout you can set for a single invocation of a standard Lambda function?

  1. 60 seconds
  2. 5 minutes
  3. 15 minutes
  4. 24 hours
Show answer

Answer: C. 15 minutes

The function timeout tops out at 900 seconds, which is 15 minutes. Five minutes is the Express workflow limit in Step Functions, not a Lambda limit.

Select all that apply

Which statements about designing Lambda functions are correct?

  1. Code should not depend on data left by a previous invocation
  2. Session or order state should be kept in a store such as DynamoDB
  3. Lambda routes all requests of one user to the same environment
  4. Memory is configurable up to 10,240 MB, with CPU in proportion
  5. The /tmp directory is fixed at 512 MB and cannot be enlarged
Show answer

Answer: A. Code should not depend on data left by a previous invocation, B. Session or order state should be kept in a store such as DynamoDB, D. Memory is configurable up to 10,240 MB, with CPU in proportion

Function code must not rely on state from an earlier invocation, so durable data belongs in an external store; memory can go up to 10,240 MB and CPU grows with it. Lambda does not pin a user's session to one execution environment, and /tmp is configurable from 512 MB up to 10,240 MB rather than fixed.

True or false

Raising a Lambda function's memory setting only adds RAM; the CPU power available to the function stays the same.

Show answer

Answer: False

False. Lambda allocates CPU in proportion to the configured memory (about one vCPU at 1,769 MB), so a CPU-bound function often runs faster, and sometimes cheaper, with more memory.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More SAA-C03 topics in this module