SkillAtlasSkill 详情

lambda

Supercharge Claude Code with AWS cloud engineering skills across 18 core AWS services.

审核状态:已审核Quality 72Security 70

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年8月21日

AWS Agent Skills

License: MIT Claude Code Last Commit GitHub Stars

Supercharge Claude Code with AWS cloud engineering skills across 18 core AWS services.

🚀 Why AWS Agent Skills?

Developing AWS solutions is complex spanning IAM, compute, storage, security, serverless, networking, and more.

AWS Agent Skills equips Claude Code (and Codex) with deep expertise across 18 AWS domains, enabling automated cloud engineering support from IaC templates to debugging guidance and security best practices.

Automatically checks AWS documentation for updates on a weekly basis to ensure skills stay current with AWS service changes.

Why not just use an MCP?

AWS MCP is great for live docs and API calls, but AWS Agent Skills is designed for reasoning first. It gives AI Agents a curated, LLM-optimized AWS knowledge base with real-world patterns, edge cases, and best practices, without streaming large docs or schemas. Because the skills are local and pre compressed, it is far more token efficient, keeps the context window small and predictable, and avoids MCP infrastructure, latency, and expanded credential exposure.

Installation

Claude Code

From Marketplace

# Add the marketplace
/plugin marketplace add itsmostafa/aws-agent-skills

# Install the plugin
/plugin install aws-agent-skills

From GitHub

/plugin install https://github.com/itsmostafa/aws-agent-skills

Local Development

/plugin install ./path/to/aws-agent-skills

Codex CLI

$skill-installer install https://github.com/itsmostafa/aws-agent-skills/<skill-name>

For example, to install the rlhf skill:

$skill-installer install https://github.com/itsmostafa/aws-agent-skills/rlhf

Available Skills

SkillDescription
iamIdentity and Access Management - users, roles, policies, permissions
lambdaServerless functions - deployment, triggers, debugging
dynamodbNoSQL database - table design, queries, indexes
s3Object storage - buckets, objects, security, lifecycle
api-gatewayREST and HTTP APIs - integrations, authorization
ec2Virtual machines - instances, AMIs, networking
ecsContainer orchestration - clusters, services, tasks
eksKubernetes - clusters, node groups, IRSA
cloudformationInfrastructure as Code - templates, stacks, drift
cloudwatchMonitoring - logs, metrics, alarms, dashboards
rdsRelational databases - instances, backups, replication
sqsMessage queues - standard, FIFO, dead-letter queues
snsNotifications - topics, subscriptions, filtering
cognitoUser authentication - user pools, identity pools, OAuth
step-functionsWorkflow orchestration - state machines, error handling
secrets-managerSecret storage - rotation, versioning, RDS integration
eventbridgeEvent bus - rules, patterns, cross-account events
bedrockFoundation models - inference, RAG, custom models

Usage Examples

IAM Policy Creation

Ask Claude to help with IAM:

  • "Create an IAM policy for Lambda to access DynamoDB"
  • "Set up cross-account access for S3"
  • "Debug this access denied error"

Lambda Development

  • "Create a Python Lambda function triggered by S3"
  • "Debug my Lambda timeout issues"
  • "Set up Lambda with VPC access"

Infrastructure as Code

  • "Write a CloudFormation template for a serverless API"
  • "Create an ECS Fargate service with load balancer"
  • "Set up EventBridge rules for scheduled tasks"

Skill Structure

Each skill contains:

  • SKILL.md - Core concepts, patterns, CLI reference, best practices, troubleshooting
  • Supplementary files - Deep dives into specific topics

Skills include metadata showing when content was last updated, so you always know how current the information is.

Contributing

  1. Fork this repository
  2. Create a feature branch
  3. Add or update skills following the SKILL.md template
  4. Submit a pull request

SKILL.md Template

---
name: service-name
description: Service description. Use when <trigger phrases>.
---

# AWS Service Name

## Overview
## Core Concepts
## Common Patterns
## CLI Reference
## Best Practices
## Troubleshooting
## References

License

MIT License - see LICENSE for details.

测试与质量

中风险

  • 来源需自行核对维护者身份。
  • 包含脚本或命令调用,安装前请复核。
  • 可能需要外部 token、网络权限或第三方服务。
  • 未检测到高风险命令。
  • 扫描发现:2 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/itsmostafa/aws-agent-skills.git
  3. 将 "skills/lambda" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/itsmostafa/aws-agent-skills.git
  3. 将 "skills/lambda" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/itsmostafa/aws-agent-skills.git
  3. 将 "skills/lambda" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/itsmostafa/aws-agent-skills.git
  3. 将 "skills/lambda" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/itsmostafa/aws-agent-skills.git
  3. 将 "skills/lambda" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
name: lambda
description: AWS Lambda serverless functions for event-driven compute. Use when creating functions, configuring triggers, debugging invocations, optimizing cold starts, setting up event source mappings, or managing layers.
last_updated: "2026-01-07"
doc_source: https://docs.aws.amazon.com/lambda/latest/dg/

AWS Lambda

AWS Lambda runs code without provisioning servers. You pay only for compute time consumed. Lambda automatically scales from a few requests per day to thousands per second.

Table of Contents

Core Concepts

Function

Your code packaged with configuration. Includes runtime, handler, memory, timeout, and IAM role.

Invocation Types

TypeDescriptionUse Case
SynchronousCaller waits for responseAPI Gateway, direct invoke
AsynchronousFire and forgetS3, SNS, EventBridge
Poll-basedLambda polls sourceSQS, Kinesis, DynamoDB Streams

Execution Environment

Lambda creates execution environments to run your function. Components:

  • Cold start: New environment initialization
  • Warm start: Reusing existing environment
  • Handler: Entry point function
  • Context: Runtime information

Layers

Reusable packages of libraries, dependencies, or custom runtimes (up to 5 per function).

Common Patterns

Create a Python Function

AWS CLI:

# Create deployment package
zip function.zip lambda_function.py

# Create function
aws lambda create-function \
  --function-name MyFunction \
  --runtime python3.12 \
  --role arn:aws:iam::123456789012:role/lambda-role \
  --handler lambda_function.handler \
  --zip-file fileb://function.zip \
  --timeout 30 \
  --memory-size 256

# Update function code
aws lambda update-function-code \
  --function-name MyFunction \
  --zip-file fileb://function.zip

boto3:

import boto3
import zipfile
import io

lambda_client = boto3.client('lambda')

# Create zip in memory
zip_buffer = io.BytesIO()
with zipfile.ZipFile(zip_buffer, 'w') as zf:
    zf.writestr('lambda_function.py', '''
def handler(event, context):
    return {"statusCode": 200, "body": "Hello"}
''')
zip_buffer.seek(0)

# Create function
lambda_client.create_function(
    FunctionName='MyFunction',
    Runtime='python3.12',
    Role='arn:aws:iam::123456789012:role/lambda-role',
    Handler='lambda_function.handler',
    Code={'ZipFile': zip_buffer.read()},
    Timeout=30,
    MemorySize=256
)

Add S3 Trigger

# Add permission for S3 to invoke Lambda
aws lambda add-permission \
  --function-name MyFunction \
  --statement-id s3-trigger \
  --action lambda:InvokeFunction \
  --principal s3.amazonaws.com \
  --source-arn arn:aws:s3:::my-bucket \
  --source-account 123456789012

# Configure S3 notification (see S3 skill)

Add SQS Event Source

aws lambda create-event-source-mapping \
  --function-name MyFunction \
  --event-source-arn arn:aws:sqs:us-east-1:123456789012:my-queue \
  --batch-size 10 \
  --maximum-batching-window-in-seconds 5

Environment Variables

aws lambda update-function-configuration \
  --function-name MyFunction \
  --environment "Variables={DB_HOST=mydb.cluster-xyz.us-east-1.rds.amazonaws.com,LOG_LEVEL=INFO}"

Create and Attach Layer

# Create layer
zip -r layer.zip python/

aws lambda publish-layer-version \
  --layer-name my-dependencies \
  --compatible-runtimes python3.12 \
  --zip-file fileb://layer.zip

# Attach to function
aws lambda update-function-configuration \
  --function-name MyFunction \
  --layers arn:aws:lambda:us-east-1:123456789012:layer:my-dependencies:1

Invoke Function

# Synchronous invoke
aws lambda invoke \
  --function-name MyFunction \
  --payload '{"key": "value"}' \
  response.json

# Asynchronous invoke
aws lambda invoke \
  --function-name MyFunction \
  --invocation-type Event \
  --payload '{"key": "value"}' \
  response.json

CLI Reference

Function Management

CommandDescription
aws lambda create-functionCreate new function
aws lambda update-function-codeUpdate function code
aws lambda update-function-configurationUpdate settings
aws lambda delete-functionDelete function
aws lambda list-functionsList all functions
aws lambda get-functionGet function details

Invocation

CommandDescription
aws lambda invokeInvoke function
aws lambda invoke-asyncAsync invoke (deprecated)

Event Sources

CommandDescription
aws lambda create-event-source-mappingAdd event source
aws lambda list-event-source-mappingsList mappings
aws lambda update-event-source-mappingUpdate mapping
aws lambda delete-event-source-mappingRemove mapping

Permissions

CommandDescription
aws lambda add-permissionAdd resource-based policy
aws lambda remove-permissionRemove permission
aws lambda get-policyView resource policy

Best Practices

Performance

  • Right-size memory: More memory = more CPU = faster execution
  • Minimize cold starts: Keep functions warm, use Provisioned Concurrency
  • Optimize package size: Smaller packages deploy faster
  • Use layers for shared dependencies
  • Initialize outside handler: Reuse connections across invocations
# GOOD: Initialize outside handler
import boto3
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('MyTable')

def handler(event, context):
    # Reuses existing connection
    return table.get_item(Key={'id': event['id']})

Security

  • Least privilege IAM roles — only grant needed permissions
  • Use Secrets Manager for sensitive data
  • Enable VPC only if needed (adds latency)
  • Encrypt environment variables with KMS

Cost Optimization

  • Set appropriate timeout — don't use max 15 minutes unnecessarily
  • Use ARM architecture (Graviton2) for 34% better price/performance
  • Batch process where possible
  • Use Reserved Concurrency to limit costs

Reliability

  • Configure DLQ for async invocations
  • Handle retries — async events retry twice
  • Make handlers idempotent
  • Use structured logging

Troubleshooting

Timeout Errors

Symptom: Task timed out after X seconds

Causes:

  • Function takes longer than timeout
  • Network call to unreachable resource
  • VPC configuration issues

Debug:

# Check function configuration
aws lambda get-function-configuration \
  --function-name MyFunction \
  --query "Timeout"

# Increase timeout
aws lambda update-function-configuration \
  --function-name MyFunction \
  --timeout 60

Out of Memory

Symptom: Function crashes with memory error

Fix:

aws lambda update-function-configuration \
  --function-name MyFunction \
  --memory-size 512

Cold Start Latency

Causes:

  • Large deployment package
  • VPC configuration
  • Many dependencies to load

Solutions:

  • Use Provisioned Concurrency
  • Reduce package size
  • Use layers for dependencies
  • Consider Graviton2 (ARM)
# Enable Provisioned Concurrency
aws lambda put-provisioned-concurrency-config \
  --function-name MyFunction \
  --qualifier LIVE \
  --provisioned-concurrent-executions 5

Permission Denied

Symptom: AccessDeniedException

Debug:

# Check execution role
aws lambda get-function-configuration \
  --function-name MyFunction \
  --query "Role"

# Check role policies
aws iam list-attached-role-policies \
  --role-name lambda-role

VPC Connectivity Issues

Symptom: Cannot reach internet or AWS services

Causes:

  • No NAT Gateway for internet access
  • Missing VPC endpoint for AWS services
  • Security group blocking outbound

Solutions:

  • Add NAT Gateway for internet
  • Add VPC endpoints for AWS services
  • Check security group rules

References

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!