# debugging-lambda-timeouts

Helps find why an AWS Lambda function times out by checking its config, CloudWatch logs and metrics, networking, and downstream dependencies, with fixes.

Skill by Amazon Web Services. Category: Shipping and ops.

## Install

Project (for this project only):

```sh
npx skills add aws/agent-toolkit-for-aws --skill debugging-lambda-timeouts
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add aws/agent-toolkit-for-aws --skill debugging-lambda-timeouts -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Warn

Installs: 5836. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/aws/agent-toolkit-for-aws/debugging-lambda-timeouts)

## Source

[Open the source](https://github.com/aws/agent-toolkit-for-aws/tree/HEAD/skills/specialized-skills/serverless-skills/debugging-lambda-timeouts). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: debugging-lambda-timeouts
description: Debugs AWS Lambda function timeout failures by systematically analyzing function configuration, CloudWatch logs and metrics, VPC/networking, cold starts, memory constraints, and downstream dependencies to identify root causes with actionable fixes. Use when a Lambda function is timing out or approaching its timeout limit.
version: 1
---

# Debugging Lambda Timeouts

## Overview

Domain expertise for systematically investigating AWS Lambda function timeout failures
by analyzing function configuration, CloudWatch logs, metrics, dependencies, cold start
patterns, and code. Identifies common causes such as insufficient timeout settings,
external service delays, database connection issues, memory constraints, and inefficient
code patterns, then provides prioritized recommendations.

## Debug a Lambda timeout

To investigate and resolve Lambda timeout issues, follow the procedure exactly.
See [Lambda timeout debugging procedure](references/lambda-timeout-debugging.md).

The procedure collects function configuration, CloudWatch metrics and logs, dependency
analysis, and cold start patterns. If Lambda code is provided, it also reviews the code
for timeout-prone patterns. Results are compiled into a structured debugging report with
prioritized recommendations.

## Troubleshooting

### Function not found

Verify the function name and region. Use `aws lambda list-functions --region <region>`
to list available functions.

### No logs available

The function may not have been invoked recently or logging may be disabled. Check the
function's log group configuration and invocation metrics.

### Access denied errors

Verify AWS credentials have permissions for Lambda, CloudWatch Logs, and CloudWatch
Metrics. See the full procedure for details.

### Log query time range issues

If CloudWatch Logs Insights queries fail with time range errors, reduce the analysis
window or check log group retention settings. See the full procedure for details.
````

- Previous: [configuring-vpc-endpoints-for-private-aws-service-access](https://syn4pse.dev/terminal/configuring-vpc-endpoints-for-private-aws-service-access.md)
- Next: [setting-up-cloudwatch-alarm-notifications](https://syn4pse.dev/terminal/setting-up-cloudwatch-alarm-notifications.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
