06. API Gateway
01. Amazon API Gateway
Amazon API Gateway is a fully managed AWS service that enables developers to create, publish, maintain, monitor, and secure APIs at any scale.
It acts as a front door for applications to access data, business logic, or functionality from your backend services.
API Gateway acts as a bridge between clients and your AWS backend services helping you create, manage, and secure APIs easily in a serverless way.
🧱 Use Case: Building a Serverless HTTP API
When building a serverless application, you can integrate:
- AWS Lambda – to execute backend logic.
- Amazon DynamoDB – to store and manage data.
- Amazon API Gateway – to expose your Lambda functions as RESTful or WebSocket APIs.
This allows external clients (websites, mobile apps, etc.) to securely access your serverless backend.
⚙️ How It Works
- A client sends an HTTP request to the API Gateway.
- The API Gateway routes the request to an AWS Lambda function.
- The Lambda function performs operations (e.g., read, create, update, delete data in DynamoDB).
- The API Gateway returns the response back to the client.
| Feature | Description |
|---|---|
| Serverless and Scalable | Automatically scales to handle any request volume. |
| Multiple API Types | Supports RESTful, HTTP, and WebSocket APIs. |
| Security | Integrates with IAM, Cognito, or custom authorizers. |
| API Throttling & Caching | Helps control usage and improve performance. |
| Monitoring | Built-in integration with CloudWatch for metrics and logs. |
| Integration Options | Works with Lambda, EC2, ECS, or any HTTP endpoint. |
🧩 Exam Tip
When you see a question about creating a serverless API, think API Gateway + Lambda.
