Sync: add infrastructure as code notes

This commit is contained in:
2026-04-24 19:58:02 +08:00
parent cc23df1883
commit e4f6f463cb
29 changed files with 2344 additions and 155 deletions

View File

@@ -0,0 +1,60 @@
---
title: "Amazon API Gateway"
type: entity
tags:
- AWS
- Serverless
- API
- Networking
sources:
- public-cloud-learning-sessions-opentext-serverless-computing-20240903-160139-mee
last_updated: 2026-04-14
---
## Aliases
- API Gateway
- Amazon API Gateway
- AWS API Gateway
## Definition
Amazon API Gateway 是 AWS 的全托管 API 管理服务,用于创建、发布、维护和监控安全的企业级 REST、HTTP 和 WebSocket API。API Gateway 作为 Lambda 函数和其他后端服务的统一入口,提供流量管理、授权和访问控制、监控等企业级能力。
## Core Properties
| 属性 | 值 |
|------|-----|
| API 类型 | REST API、HTTP API、WebSocket API |
| 部署选项 | Edge-Optimized、Regional、Private |
| 认证方式 | IAM 角色、Lambda Authorizer、Cognito、API Key |
| 协议 | HTTPSTLS 终止由 AWS 管理) |
| 限流 | 按账户/按 API/按客户多级限流 |
| 缓存 | 可选 API 缓存,提升响应速度 |
| 监控 | CloudWatch 集成,提供延迟、错误率等指标 |
## Deployment Options
| 选项 | 说明 | 适用场景 |
|------|------|---------|
| Edge-Optimized | 通过 CloudFront CDN 全球分发,低延迟 | 面向全球用户的公共 API |
| Regional | 部署在单一区域,自带高可用 | 面向同区域用户、VPC 内的 API |
| Private | 仅可通过 VPC 内部端点访问 | 企业内部 API、微服务间通信 |
## Typical Architecture
```
客户端 → API Gateway → Lambda Function → DynamoDB/SQS/etc.
```
API Gateway 负责:
1. TLS 终止(安全)
2. 请求验证(格式、参数)
3. 限流和配额管理
4. 授权和身份验证
5. 请求路由到后端 Lambda
6. 响应转换和格式统一
## Connections
- [[Amazon-API-Gateway]] ← exposes ← [[AWS-Lambda]]
- [[Amazon-API-Gateway]] ← provides ← [[Serverless-Computing]]
- [[Amazon-API-Gateway]] ← monitored_by ← [[CloudWatch]]