CLOUD / A CONCEPT NOTE

Serverless

run code without provisioning or managing servers

~85 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

You upload a function (AWS Lambda, GCP Cloud Functions) or a container (Cloud Run), and the platform handles scaling, availability, and patching. You're charged per invocation and compute duration — zero cost when idle. The function is stateless and limited to a maximum execution timeout (usually 15 minutes for Lambda, 60 for Cloud Run).

02 / FOLLOW THE MECHANISM

How a lambda invocation flows

  1. Trigger

    an S3 upload, an API Gateway HTTP request, or an SQS message invokes the function.

  2. Lambda service

    finds or creates an execution environment (sandbox) with the configured memory and runtime.

  3. Lambda runtime

    downloads your code from S3, initializes the runtime (Python, Node, Go, etc.), and runs the handler outside the init phase.

  4. Your handler

    receives the event payload and context object (request ID, deadline, etc.). Returns a response or throws an error.

  5. Platform

    freezes the environment for reuse (warm start) or tears it down after inactivity (~5–15 minutes).

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

invoke a Lambda synchronously

aws lambda invoke --function-name my-fn response.json

EXAMPLE 02 · REFERENCE

list all Lambda functions in the region

aws lambda list-functions

Explore command anatomy in the CLI lab