# AWS API Gateway

> Amazon API Gateway is a managed service to create, publish, secure and monitor REST, HTTP and WebSocket APIs in front of Lambda functions and other backends.

- Source: https://www.itwonderlab.com/aws-api-gateway/
- Published: 2026-10-05
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

**Amazon API Gateway** is a fully managed service that makes it easy to publish APIs at any scale. It is the "front door" that receives the HTTP requests of clients and sends them to a backend: [Lambda](https://www.itwonderlab.com/aws-lambda/) functions, HTTP services behind a [load balancer](https://www.itwonderlab.com/aws-elastic-load-balancing/), or other AWS services.

### API types

- **HTTP APIs**: the simpler and cheaper option, with low latency, JWT authorizers and Lambda or HTTP integrations.
- **REST APIs**: more features: API keys and usage plans, request validation and transformation, caching, WAF integration and private endpoints.
- **WebSocket APIs**: two-way communication for chat, dashboards and games.

### Key concepts

- **Routes/resources and methods**, **integrations** to the backend and **stages** (`dev`, `prod`) with their own settings and variables.
- **Authorization**: [IAM](https://www.itwonderlab.com/aws-iam/), Amazon Cognito, JWT and custom Lambda authorizers.
- **Throttling** and **quotas** protect the backends; a **custom domain name** with a certificate from [ACM](https://www.itwonderlab.com/aws-acm/) and a record in [Route 53](https://www.itwonderlab.com/aws-route-53/) gives the API its own URL.
- **Protection**: attach [AWS WAF](https://www.itwonderlab.com/aws-waf/) to a REST API; the endpoint can be Regional, edge-optimized (through [CloudFront](https://www.itwonderlab.com/amazon-cloudfront/)) or private inside a [VPC](https://www.itwonderlab.com/aws-vpc/).
- **Monitoring**: access logs and metrics in [CloudWatch](https://www.itwonderlab.com/aws-cloudwatch/).

### Pricing

Per million API calls (and per message and connection minute for WebSocket), plus optional cache and data transfer. HTTP APIs cost less than REST APIs. See the [API Gateway pricing](https://aws.amazon.com/api-gateway/pricing/).

### With Terraform

The resources are `aws_apigatewayv2_api` (HTTP and WebSocket APIs) and `aws_api_gateway_rest_api` with its resources, methods, integrations, deployments and stages.
