title | description |
---|---|
REST API |
Core utility |
???+ warning "Don't use in production (yet)" This feature is currently under development. As such it's considered not stable and we might make significant breaking changes before going before its release{target="_blank"}. You are welcome to provide feedback{target="_blank"} and contribute to the project{target="_blank"}.
Event handler for Amazon API Gateway REST and HTTP APIs, Application Loader Balancer (ALB), Lambda Function URLs, and VPC Lattice.
- Lightweight routing to reduce boilerplate for API Gateway REST/HTTP API, ALB and Lambda Function URLs.
- Support for CORS, binary and Gzip compression, Decimals JSON encoding and bring your own JSON serializer
- Built-in integration with Parser{target="_blank"} for easy payload validation and parsing
- Works with micro function (one or a few routes) and monolithic functions (all routes)
???+ tip All examples shared in this documentation are available within the project repository{target="_blank"}.
npm install @aws-lambda-powertools/event-handler
If you're using any API Gateway integration, you must have an existing API Gateway Proxy integration{target="_blank"} or ALB{target="_blank"} configured to invoke your Lambda function.
In case of using VPC Lattice{target="_blank"}, you must have a service network configured to invoke your Lambda function.
This is the sample infrastructure for API Gateway and Lambda Function URLs we are using for the examples in this documentation.
???+ info "There is no additional permissions or dependencies required to use this utility."
=== "API Gateway SAM Template"
```yaml title="AWS Serverless Application Model (SAM) example"
```
=== "Lambda Function URL SAM Template"
```yaml title="AWS Serverless Application Model (SAM) example"
```