API Gateway
- Support
web-socketprotocol - Handle
APIversioning- Multiple Environment
- Security (Authentication, Authorization)
- Using
APIkeys, handle request throattling Swagger/Open APIto importDefinition- Transform and validate the
RequestandResponse - Generate
SDKandAPI Specification - Cache
APIresponse
Integration
- Lambda
- Invoke
Lambdafunction - Expose
REST APIbacked byLambda - HTTP Endpoint
- AWS Service
- Expose any
AWS ServiceasAPI Gateway
Endpoint Types
- 3 types of
API Gateway Endpoints - Edge Optimized
- This is
defaultbehavior APIis only one region- But to improve latency, request is routed through
Cloudfront Edge Locations
- This is
- Regional
APIis in the one region- With combination of
Cloudfront - We can get
Edge Optimizedbehavior - In this case, we have more control over
- Caching
- Strategies
- Distribution
- Private
- Use inside the
VPCasVPC Endpoint - Resource policy is used to define access
- Use inside the
Security
IAM- When users/roles is within
AWS Account - Handle
AuthenticationandAuthorization - Leverage Sig v4
- It's the
IAMcredentials in theHTTP Header
- It's the
Custom AuthorizerorLambda Authorizer- When users are from 3rd party
Lambda Authorizedcan be cachedCUPorCognito User Pool- When user pools are manages by Facebook, Google login
- No need to write custom code
- Only provide
Authentication Authorizationmust be provided from the backend code- Access of developer and users can be separated using
IAM Permission - Developer can manage and deploy API
- User can call API
- SSL/TLS though
AWS Certificate Manageris free forAPI Gateway