AWS API Gateway
AWS API Gateway is a fully managed service provided by Amazon Web
Services that allows developers to create, publish, maintain, monitor, and secure
APIs (Application Programming Interfaces) at any scale.
What is an API Gateway?
An API Gateway acts as a reverse proxy to accept all application
programming interface (API) calls, aggregate the various services required to
fulfil them, and return the appropriate result.
Key Components of AWS API Gateway:
1. API – A collection of resources and methods.
2. Resource – A URL path (e.g., /users, /orders) that represents a part of the
API.
3. Method – HTTP methods (GET, POST, PUT, DELETE) that can be
associated with a resource.
4. Integration – Backend to which API Gateway routes requests (e.g.,
Lambda, HTTP endpoint, AWS service).
5. Usage Plan & API Key – Controls and limits access to your API.
Types of APIs Supported:
REST APIs – Fully featured, suitable for most workloads.
HTTP APIs – Lightweight, cheaper, and faster for simple use cases.
WebSocket APIs – For real-time two-way communication (e.g., chat apps,
live notifications).
Common Integration Types:
AWS Lambda – Serverless functions.
HTTP/HTTPS Endpoints – Call other web services.
AWS Services – Direct integration with AWS services like DynamoDB, S3.
Security Features:
IAM Authorization – Use IAM roles and policies.
Lambda Authorizers – Custom token or request-based authentication.
Amazon Cognito – User pools for authentication.
API Keys – For controlling and monitoring usage.
Monitoring & Logging:
Integrated with Amazon CloudWatch for:
o Logs
o Metrics (e.g., 4XX/5XX errors, latency)
o Alarms
Advantages:
Serverless and scalable.
Integrated with AWS services.
Secure and manageable.
Easy to deploy and version APIs.
Global availability.
Use Cases:
Creating RESTful APIs for front-end applications.
Backend for mobile/web apps.
Serverless microservices architecture.
Securely exposing AWS services.