AWS Lambda enables you to run code without provisioning or managing servers. Build serverless applications using event-driven triggers, pay only for compute time consumed, and scale automatically with workload.
When to Use
API endpoints and webhooks
Scheduled batch jobs and data processing
Real-time file processing (S3 uploads)
Event-driven workflows (SNS, SQS)
Microservices and backend APIs
Data transformations and ETL jobs
IoT and sensor data processing
WebSocket connections
Quick Start
Minimal working example:
# Create Lambda execution role
aws iam create-role \
--role-name lambda-execution-role \
--assume-role-policy-document '{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {"Service": "lambda.amazonaws.com"},
"Action": "sts:AssumeRole"
}]
}'
# Attach basic execution policy
aws iam attach-role-policy \
--role-name lambda-execution-role \
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
# Create function from ZIP
zip function.zip index.js
aws lambda create-function \
--function-name my-function \
--runtime nodejs18.x \
--role arn:aws:iam::ACCOUNT:role/lambda-execution-role \
--handler index.handler \
--zip-file fileb://function.zip \
// ... (see reference guides for full implementation)
Reference Guides
Detailed implementations in the references/ directory:
Guide
Contents
Basic Lambda Function with AWS CLI
Basic Lambda Function with AWS CLI
Lambda Function with Node.js
Lambda Function with Node.js
Terraform Lambda Deployment
Terraform Lambda Deployment
Lambda with SAM (Serverless Application Model)
Lambda with SAM (Serverless Application Model)
Lambda Layers for Code Sharing
Lambda Layers for Code Sharing
Best Practices
✅ DO
Use environment variables for configuration
Implement proper error handling and logging
Optimize package size and dependencies
Set appropriate timeout and memory
Use Lambda Layers for shared code
Implement concurrency limits
Enable X-Ray tracing for debugging
Use reserved concurrency for critical functions
❌ DON'T
Store sensitive data in code
Create long-running operations (>15 min)
Ignore cold start optimization
Forget to handle concurrent executions
Ignore CloudWatch metrics
Use too much memory unnecessarily
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: aj-geddes-useful-ai-prompts-aws-lambda-functions3description: AWS Lambda Functions4---56# AWS Lambda Functions78## Table of Contents910- [Overview](#overview)11- [When to Use](#when-to-use)12- [Quick Start](#quick-start)13- [Reference Guides](#reference-guides)14- [Best Practices](#best-practices)1516## Overview1718AWS Lambda enables you to run code without provisioning or managing servers. Build serverless applications using event-driven triggers, pay only for compute time consumed, and scale automatically with workload.1920## When to Use2122- API endpoints and webhooks23- Scheduled batch jobs and data processing24- Real-time file processing (S3 uploads)25- Event-driven workflows (SNS, SQS)26- Microservices and backend APIs27- Data transformations and ETL jobs28- IoT and sensor data processing29- WebSocket connections3031## Quick Start3233Minimal working example:3435```bash36# Create Lambda execution role37aws iam create-role \38 --role-name lambda-execution-role \39 --assume-role-policy-document '{40 "Version": "2012-10-17",41 "Statement": [{42 "Effect": "Allow",43 "Principal": {"Service": "lambda.amazonaws.com"},44 "Action": "sts:AssumeRole"45 }]46 }'4748# Attach basic execution policy49aws iam attach-role-policy \50 --role-name lambda-execution-role \51 --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole5253# Create function from ZIP54zip function.zip index.js55aws lambda create-function \56 --function-name my-function \57 --runtime nodejs18.x \58 --role arn:aws:iam::ACCOUNT:role/lambda-execution-role \59 --handler index.handler \60 --zip-file fileb://function.zip \61// ... (see reference guides for full implementation)62```6364## Reference Guides6566Detailed implementations in the `references/` directory:6768| Guide | Contents |69|---|---|70| [Basic Lambda Function with AWS CLI](references/basic-lambda-function-with-aws-cli.md) | Basic Lambda Function with AWS CLI |71| [Lambda Function with Node.js](references/lambda-function-with-nodejs.md) | Lambda Function with Node.js |72| [Terraform Lambda Deployment](references/terraform-lambda-deployment.md) | Terraform Lambda Deployment |73| [Lambda with SAM (Serverless Application Model)](references/lambda-with-sam-serverless-application-model.md) | Lambda with SAM (Serverless Application Model) |74| [Lambda Layers for Code Sharing](references/lambda-layers-for-code-sharing.md) | Lambda Layers for Code Sharing |7576## Best Practices7778### ✅ DO7980- Use environment variables for configuration81- Implement proper error handling and logging82- Optimize package size and dependencies83- Set appropriate timeout and memory84- Use Lambda Layers for shared code85- Implement concurrency limits86- Enable X-Ray tracing for debugging87- Use reserved concurrency for critical functions8889### ❌ DON'T9091- Store sensitive data in code92- Create long-running operations (>15 min)93- Ignore cold start optimization94- Forget to handle concurrent executions95- Ignore CloudWatch metrics96- Use too much memory unnecessarily9798---99> Converted and distributed by [TomeVault](https://tomevault.io/claim/aj-geddes) — claim your Tome and manage your conversions.100<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/aj-geddes-useful-ai-prompts-aws-lambda-functions in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
AWS Lambda Functions It is listed under DevOps & Infra on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.