aws-lambda-management
AWS Lambda function deployment, management, and monitoring for DevOps and cloud engineers.
- License 许可
- GPL-3.0
- 最近更新
- 2026-10-21
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- aws-lambda-management
- description
- AWS Lambda function deployment, management, and monitoring for DevOps and cloud engineers.
03 SKILL.md 正文
AWS Lambda Management Skill
Status: ACTIVE
Mode: devops-engineer, aws-engineer
MCP Server: aws-lambda
Last Updated: 2026-05-22
Overview
This skill provides a structured runbook for managing AWS Lambda functions using the AWS Lambda MCP server. It covers function deployment, code updates, layer management, alias configuration, and permission handling.
Use this skill when:
- Deploying new Lambda functions
- Updating function code or configuration
- Managing Lambda layers and dependencies
- Creating/updating function aliases
- Configuring function permissions and triggers
- Troubleshooting Lambda deployment issues
Prerequisites
- AWS Credentials:
AWS_PROFILEandAWS_REGIONenvironment variables configured - IAM Permissions: User/role must have
lambda:*permissions (or scoped equivalents) - MCP Server:
aws-lambdaupstream active inmcp-proxy - Tool Access: Verify tools available via
mcp_search("lambda")
Core Workflows
Workflow 1: List and Inspect Functions
Goal: Discover existing Lambda functions and inspect their configuration.
Steps:
-
List all functions in the region:
mcp_call(ref="t:aws-lambda.list_functions", args={})Returns: Array of function metadata (name, ARN, runtime, handler, memory, timeout)
-
Get detailed function configuration:
mcp_call(ref="t:aws-lambda.get_function", args={ "function_name": "my-function" })Returns: Full function config, code location, environment variables, VPC settings, layers
-
Get function code location:
mcp_call(ref="t:aws-lambda.get_function_code_location", args={ "function_name": "my-function" })Returns: S3 bucket, key, and signed URL for downloading function code
Decision Tree:
- If function not found → Check function name spelling and region
- If function found → Proceed to Workflow 2 (update) or Workflow 3 (invoke)
Workflow 2: Deploy or Update Function Code
Goal: Create a new Lambda function or update existing function code.
Steps:
-
Create new function:
mcp_call(ref="t:aws-lambda.create_function", args={ "function_name": "my-new-function", "runtime": "nodejs18.x", "role": "arn:aws:iam::ACCOUNT:role/lambda-execution-role", "handler": "index.handler", "code": { "ZipFile": "<base64-encoded-zip>" }, "timeout": 30, "memory_size": 256, "environment": { "variables": { "LOG_LEVEL": "INFO" } } })Returns: Function ARN, version, state
-
Update function code (existing function):
mcp_call(ref="t:aws-lambda.update_function_code", args={ "function_name": "my-function", "zip_file": "<base64-encoded-zip>" })Returns: New code SHA256, version, state
-
Update function configuration:
mcp_call(ref="t:aws-lambda.update_function_configuration", args={ "function_name": "my-function", "timeout": 60, "memory_size": 512, "environment": { "variables": { "LOG_LEVEL": "DEBUG" } } })Returns: Updated config, last modified timestamp
Decision Tree:
- If creating new function → Verify IAM role exists and has trust policy for Lambda
- If updating code → Verify ZIP file is valid and contains handler
- If updating config → Verify timeout and memory are within Lambda limits (15 min timeout, 128-10240 MB memory)
Workflow 3: Invoke Function
Goal: Test or trigger a Lambda function synchronously.
Steps:
-
Invoke function synchronously:
mcp_call(ref="t:aws-lambda.invoke_function", args={ "function_name": "my-function", "invocation_type": "RequestResponse", "payload": { "key": "value" } })Returns: Status code, response payload, function logs (if LogType=Tail)
-
Invoke asynchronously (fire-and-forget):
mcp_call(ref="t:aws-lambda.invoke_function", args={ "function_name": "my-function", "invocation_type": "Event", "payload": { "key": "value" } })Returns: Status code, request ID (no response payload)
Decision Tree:
- If testing function → Use
RequestResponseto see output - If triggering background job → Use
Eventfor async invocation - If invocation fails → Check CloudWatch logs via
aws-cloudwatchMCP server
Workflow 4: Manage Lambda Layers
Goal: Create and manage Lambda layers for shared dependencies.
Steps:
-
List layers:
mcp_call(ref="t:aws-lambda.list_layers", args={})Returns: Layer names, ARNs, latest version
-
Get layer version:
mcp_call(ref="t:aws-lambda.get_layer_version", args={ "layer_name": "my-layer", "version_number": 1 })Returns: Layer ARN, code size, compatible runtimes
-
Publish new layer version:
mcp_call(ref="t:aws-lambda.publish_layer_version", args={ "layer_name": "my-layer", "zip_file": "<base64-encoded-zip>", "compatible_runtimes": ["nodejs18.x", "nodejs20.x"] })Returns: Layer ARN, version number, code SHA256
-
Delete layer version:
mcp_call(ref="t:aws-lambda.delete_layer_version", args={ "layer_name": "my-layer", "version_number": 1 })Returns: Success confirmation
Decision Tree:
- If creating shared dependencies → Use layers instead of bundling with function
- If updating layer → Publish new version, don't delete old versions (functions may reference them)
- If cleaning up → Delete only unused versions
Workflow 5: Manage Function Aliases
Goal: Create and manage Lambda function aliases for versioning and traffic shifting.
Steps:
-
List aliases:
mcp_call(ref="t:aws-lambda.list_aliases", args={ "function_name": "my-function" })Returns: Alias names, function versions, routing configs
-
Create alias:
mcp_call(ref="t:aws-lambda.create_alias", args={ "function_name": "my-function", "name": "prod", "function_version": "5" })Returns: Alias ARN, function version
-
Update alias (traffic shifting):
mcp_call(ref="t:aws-lambda.update_alias", args={ "function_name": "my-function", "name": "prod", "function_version": "6", "routing_config": { "additional_version_weight": { "5": 0.1 } } })Returns: Updated alias config with routing weights
-
Delete alias:
mcp_call(ref="t:aws-lambda.delete_alias", args={ "function_name": "my-function", "name": "prod" })Returns: Success confirmation
Decision Tree:
- If deploying new version → Create alias pointing to new version
- If canary deploying → Use routing_config to split traffic (90% old, 10% new)
- If rolling back → Update alias to point to previous version
Workflow 6: Manage Function Permissions
Goal: Configure Lambda resource-based policies for triggers and cross-account access.
Steps:
-
Get current policy:
mcp_call(ref="t:aws-lambda.get_policy", args={ "function_name": "my-function" })Returns: Policy document (JSON)
-
Add permission (e.g., allow API Gateway to invoke):
mcp_call(ref="t:aws-lambda.add_permission", args={ "function_name": "my-function", "statement_id": "AllowAPIGateway", "action": "lambda:InvokeFunction", "principal": "apigateway.amazonaws.com", "source_arn": "arn:aws:execute-api:REGION:ACCOUNT:API_ID/*" })Returns: Updated policy
-
Remove permission:
mcp_call(ref="t:aws-lambda.remove_permission", args={ "function_name": "my-function", "statement_id": "AllowAPIGateway" })Returns: Success confirmation
Decision Tree:
- If setting up trigger → Add permission for the service (SNS, SQS, EventBridge, etc.)
- If cross-account access → Use principal as cross-account role ARN
- If removing trigger → Remove corresponding permission statement
Troubleshooting
Issue: Function not found
Cause: Wrong function name or region
Resolution:
- List functions:
mcp_call(ref="t:aws-lambda.list_functions", args={}) - Verify function name matches exactly
- Check
AWS_REGIONenvironment variable
Issue: Permission denied on create/update
Cause: IAM role lacks lambda:CreateFunction or lambda:UpdateFunctionCode
Resolution:
- Verify IAM role has
lambda:*or scoped permissions - Check trust policy allows Lambda service
- Use
aws-iamMCP server to inspect role policies
Issue: Invocation timeout
Cause: Function execution exceeds timeout setting
Resolution:
- Check function timeout:
mcp_call(ref="t:aws-lambda.get_function", args={"function_name": "..."}) - Increase timeout:
mcp_call(ref="t:aws-lambda.update_function_configuration", args={"function_name": "...", "timeout": 300}) - Check CloudWatch logs for slow operations
Issue: Code update fails
Cause: ZIP file too large (>50 MB) or invalid format
Resolution:
- Verify ZIP contains handler file
- If >50 MB, use S3 upload:
mcp_call(ref="t:aws-lambda.update_function_code", args={"function_name": "...", "s3_bucket": "...", "s3_key": "..."}) - Check ZIP integrity locally before uploading
Integration with Other Skills
aws-cloudwatch-observability: Use to view Lambda logs and metrics after invocationaws-iam-analysis: Use to inspect Lambda execution role policiesaws-ecs-troubleshooting: Use for comparing Lambda vs ECS deployment patterns
References
04 同仓库更多 Skills
ugip
Unified Global Initialization Protocol. Run at the start of every session to initialize GitNexus, flush .ai-memory/ to Qdrant, read ROO_CODE_CONTEXT.md, check the git branch, and run role-specific recall_context queries. Invoke with /ugip.
template-skill
Replace with description of the skill and when Claude should use it.
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
puppeteer-automation
Comprehensive Puppeteer automation skill for web scraping, browser testing, screenshot generation, form automation, and performance monitoring. Use when tasks involve browser automation, web testing, data extraction, or UI validation.
model-enhancement-mcp
Guide for creating MCP servers that enhance LLM reasoning through structured processes, persistence, and workflow guidance. Use when building MCP servers for structured thinking, journaling, memory systems, or other cognitive enhancement patterns.
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).