Skip to content
Back to skills

Connecting Lambda To Api Gateway

ASecurity

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.

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 10, 2026
ai-agentsawstestinggitapisecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 10, 2026

npx -y skills add mouadja02/skills --skill connecting-lambda-to-api-gateway --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Connecting Lambda To Api Gateway?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Connecting Lambda To Api Gateway
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mouadja02-connecting-lambda-to-api-gateway/badge)](https://www.skillsdirectory.com/skills/mouadja02-connecting-lambda-to-api-gateway)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
license: Apache-2.0
source: https://github.com/aws/agent-toolkit-for-aws
attribution: "Amazon Web Services - agent-toolkit-for-aws (Apache-2.0)"
name: connecting-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.
version: 1
---

# 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](references/lambda-gateway-api.md).

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.

Files in this skill

  • SKILL.md1.8 KB
  • references/lambda-gateway-api.md10.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…