AWS Lambda Functions

AWS Lambda Functions

Guides an AI agent to create and deploy AWS Lambda functions with event sources, IAM permissions, layers and environment configuration, using the CLI, SAM and Terraform.

Skill files8 files

references/

scripts/

templates/

SKILL.md100 lines
1
---
2
name: aws-lambda-functions
3
description: >
4
Create and deploy serverless functions using AWS Lambda with event sources,
5
permissions, layers, and environment configuration. Use for event-driven
6
computing without managing servers.
7
---
8
9
# AWS Lambda Functions
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
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.
22
23
## When to Use
24
25
- API endpoints and webhooks
26
- Scheduled batch jobs and data processing
27
- Real-time file processing (S3 uploads)
28
- Event-driven workflows (SNS, SQS)
29
- Microservices and backend APIs
30
- Data transformations and ETL jobs
31
- IoT and sensor data processing
32
- WebSocket connections
33
34
## Quick Start
35
36
Minimal working example:
37
38
```bash
39
# Create Lambda execution role
40
aws iam create-role \
41
--role-name lambda-execution-role \
42
--assume-role-policy-document '{
43
"Version": "2012-10-17",
44
"Statement": [{
45
"Effect": "Allow",
46
"Principal": {"Service": "lambda.amazonaws.com"},
47
"Action": "sts:AssumeRole"
48
}]
49
}'
50
51
# Attach basic execution policy
52
aws iam attach-role-policy \
53
--role-name lambda-execution-role \
54
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
55
56
# Create function from ZIP
57
zip function.zip index.js
58
aws lambda create-function \
59
--function-name my-function \
60
--runtime nodejs18.x \
61
--role arn:aws:iam::ACCOUNT:role/lambda-execution-role \
62
--handler index.handler \
63
--zip-file fileb://function.zip \
64
// ... (see reference guides for full implementation)
65
```
66
67
## Reference Guides
68
69
Detailed implementations in the `references/` directory:
70
71
| Guide | Contents |
72
|---|---|
73
| [Basic Lambda Function with AWS CLI](references/basic-lambda-function-with-aws-cli.md) | Basic Lambda Function with AWS CLI |
74
| [Lambda Function with Node.js](references/lambda-function-with-nodejs.md) | Lambda Function with Node.js |
75
| [Terraform Lambda Deployment](references/terraform-lambda-deployment.md) | Terraform Lambda Deployment |
76
| [Lambda with SAM (Serverless Application Model)](references/lambda-with-sam-serverless-application-model.md) | Lambda with SAM (Serverless Application Model) |
77
| [Lambda Layers for Code Sharing](references/lambda-layers-for-code-sharing.md) | Lambda Layers for Code Sharing |
78
79
## Best Practices
80
81
### ✅ DO
82
83
- Use environment variables for configuration
84
- Implement proper error handling and logging
85
- Optimize package size and dependencies
86
- Set appropriate timeout and memory
87
- Use Lambda Layers for shared code
88
- Implement concurrency limits
89
- Enable X-Ray tracing for debugging
90
- Use reserved concurrency for critical functions
91
92
### ❌ DON'T
93
94
- Store sensitive data in code
95
- Create long-running operations (>15 min)
96
- Ignore cold start optimization
97
- Forget to handle concurrent executions
98
- Ignore CloudWatch metrics
99
- Use too much memory unnecessarily
100

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…