New advertisers: 50% off your first month with code FIRSTMONTHSee slots
aws avatar

Connecting Lambda To Api Gateway

Connects an existing Lambda function to API Gateway with proxy integration, CORS, permissions, and deployment.

skills.sh installs
7.3K
GitHub stars
3.5K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers creating a REST API, resource and method setup, Lambda proxy integration, and stage deployment
  • Supports configurable authorization types: NONE, AWS_IAM, COGNITO_USER_POOLS, and CUSTOM, plus optional API keys
  • Includes production hardening for throttling and access logging, with CORS setup and troubleshooting for 502 and permission errors
  • Designed for developers wiring existing Lambda functions to a REST or HTTP API without hand-building each resource

Install

$ npx -y skills add aws/agent-toolkit-for-aws --skill connecting-lambda-to-api-gateway -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

Details

Repository
github.com/aws/agent-toolkit-for-aws
Categories
Backend & APIs, DevOps & Cloud
First seen
May 16, 2026

More from aws/agent-toolkit-for-aws

All 54

Similar to Connecting Lambda To Api Gateway

More Backend & APIs