contentintech

Serverless Cheatsheet

Quick reference for FaaS deploy commands, triggers, cold-start fixes, limits, and cross-cloud names.

LambdaFaaSEvent-DrivenCold Start
NotesCheatsheet

Deploy — AWS Lambda

# Create
zip function.zip index.mjs
aws lambda create-function --function-name hello \
  --runtime nodejs22.x --handler index.handler \
  --zip-file fileb://function.zip \
  --role arn:aws:iam::ACCT:role/lambda-exec

# Update + invoke
aws lambda update-function-code --function-name hello \
  --zip-file fileb://function.zip
aws lambda invoke --function-name hello --payload '{}' out.json

# Provisioned concurrency (no cold starts)
aws lambda put-provisioned-concurrency-config \
  --function-name hello --qualifier prod \
  --provisioned-concurrent-executions 5

Deploy — GCP & Azure

GCP Cloud Run functions

gcloud functions deploy hello --gen2 \
  --runtime=python312 --region=us-central1 \
  --source=. --entry-point=hello \
  --trigger-http --allow-unauthenticated

# Storage trigger
gcloud functions deploy on-upload --gen2 \
  --trigger-event-filters="type=google.cloud.storage.object.v1.finalized" \
  --trigger-event-filters="bucket=my-bucket"

Azure Functions

func init MyApp --dotnet
func new --name Hello --template "HTTP trigger"
func azure functionapp publish my-func-app

Triggers

TriggerModel
HTTPSynchronous
Queue / TopicAsync / poll
Object storageAsync
Schedule (cron)Async
StreamPoll (batched)

Cold Start Fixes

// Init clients OUTSIDE the handler (reused when warm)
const db = new DynamoDBClient({});

export const handler = async (event) => { /* db already warm */ };
  • Smaller deploy packages / lighter runtimes
  • Init SDKs, pools, config outside handler
  • Provisioned concurrency (Lambda) / min instances (Cloud Run)
  • Avoid heavy dependency trees

Limits (typical)

LimitLambda
Max timeout15 min
Memory128 MB – 10 GB
Sync payload6 MB
/tmp storage512 MB – 10 GB

Cross-Cloud Map

AWSAzureGCP
LambdaFunctionsCloud Run functions
SQSQueue StoragePub/Sub
Step FunctionsDurable FunctionsWorkflows
EventBridgeEvent GridEventarc

Section navigation