
Skill
connecting-lambda-to-api-gateway
connect AWS Lambda to API Gateway
Description
Connects an existing AWS Lambda function to Amazon API Gateway by creating a REST or HTTP API with resource/method setup, Lambda proxy integration, permissions, and deployment. Always use this skill when connecting Lambda to API Gateway — it handles CORS, throttling, access logging, and production security hardening that are easy to miss.
SKILL.md
Connecting Lambda to API Gateway
Overview
Domain expertise for creating Amazon API Gateway REST APIs and connecting them to existing Lambda functions. Covers API creation, resource and method setup, Lambda proxy integration, CORS configuration, security controls, deployment, and testing.
Connect a Lambda function to API Gateway
To create a REST API and wire it to a Lambda function, follow the procedure exactly. See Lambda to API Gateway connection procedure.
The procedure supports configurable authorization types (NONE, AWS_IAM, COGNITO_USER_POOLS, CUSTOM), optional API key requirements, CORS setup, and production security hardening including throttling and access logging.
Troubleshooting
502 Bad Gateway
The Lambda function must return a proxy-compatible response with statusCode,
headers, and a stringified body. See the full procedure for format details.
Permission denied invoking Lambda
Ensure lambda:InvokeFunction permission was added with the correct API Gateway
source ARN. See the full procedure for details.
CORS errors in browser
Verify enable_cors was set to true, the OPTIONS method was created, and CORS
headers are configured in both method and integration responses.
More skills from the agent-toolkit-for-aws repository
View all 105 skillsagents-build
add capabilities to existing agent projects
Jul 12AgentsAutomationAWSEngineeringagents-connect
connect agents to external services
Jul 16AgentsAPI DevelopmentAuthenticationAWSagents-debug
debug agent and environment issues
Jul 16AgentsAWSDebuggingObservabilityagents-deploy
deploy AI agents to AWS
Jul 12AgentsAWSCI/CDDeploymentagents-get-started
scaffold and deploy new agent projects
Jul 12AgentsAWSDeploymentagents-harden
harden agents for production
Jul 16AgentsAWSBest PracticesSecurity
More from AWS (Amazon)
View publisheragents-optimize
optimize agent quality and performance
agent-toolkit-for-aws
Jul 12AgentsAWSEvalsObservability +1amazon-aurora-mysql
manage Amazon Aurora MySQL clusters
agent-toolkit-for-aws
Jul 12AWSDatabaseMySQLServerlessamazon-aurora-postgresql
configure Amazon Aurora PostgreSQL clusters
agent-toolkit-for-aws
Jul 16AWSDatabasePostgreSQLServerlessamazon-bedrock
build generative AI apps with Amazon Bedrock
agent-toolkit-for-aws
Jul 19AgentsAWSLLMamazon-documentdb
manage Amazon DocumentDB clusters
agent-toolkit-for-aws
Jul 12AWSDatabaseMongoDBNoSQLamazon-dynamodb
design and debug DynamoDB data layers
agent-toolkit-for-aws
Jul 16AWSDatabaseNoSQL