SuchithraChandrasekaran/aws-devops-platform
GitHub: SuchithraChandrasekaran/aws-devops-platform
基于AWS Free Tier构建的生产级DevOps平台,完整覆盖AWS DevOps Engineer Professional认证的全部六个领域。
Stars: 3 | Forks: 0
# AWS DevOps Engineer Professional — 平台项目
一个生产级的 AWS DevOps 平台,涵盖 **AWS Certified DevOps Engineer – Professional** 考试的所有 6 个领域。每个组件均使用真实的基础设施部署在 AWS Free Tier 上。
## 架构概述
*AWS DevOps 平台架构 -Local Stack*

*AWS DevOps 平台架构 -AWS Free-Tier*

```
[ GitHub ] → [ CodePipeline / GitHub Actions ] → [ Docker Build ]
↓
[ Trivy Security Scan ]
↓
[ Blue-Green Deploy on EC2/ECS ]
↓
┌─────────────────────────────────────────┐
│ VPC · RDS PostgreSQL · DynamoDB │
│ Lambda · Step Functions · S3 │
└─────────────────────────────────────────┘
↓
[ CloudWatch · Prometheus · Grafana · SNS ]
```
## 领域覆盖
本项目直接对应 **DOP-C02** 考试指南的所有 6 个领域:
### D1 · SDLC 自动化 — 22%
**服务:** CodeCommit, CodeBuild, CodeDeploy, CodePipeline, CodeArtifact, CodeGuru, ECR (lifecycle), ECS / EKS, Lambda (traffic shift), SAM / CDK, Elastic Beanstalk, GitHub Actions, buildspec.yml, AppSpec hooks
**构建内容:**
- 结合 GitHub Actions 和 CodePipeline 的完整 CI/CD pipeline
- 蓝绿、滚动和金丝雀部署策略
- Trivy 容器扫描和 SonarCloud 代码质量门禁
- Docker 容器化与 S3 artifact 管理
- 具备自动回滚功能的 CodeDeploy 生命周期 hooks
### D2 · Config Mgmt 与 IaC — 17%
**服务:** CloudFormation, StackSets (OUs), CDK (L2/L3), SAM templates, Terraform (remote state), SSM Parameter Store, Secrets Manager, AppConfig, Config Conformance Packs, CfCT Pipeline, Drift Detection, Nested Stacks, Custom Resources / Macros
**构建内容:**
- Terraform 模块、工作区以及带有 DynamoDB 锁定的 S3 remote state
- CloudFormation 嵌套堆栈和多环境模板
- 用于配置管理的 SSM Parameter Store
- 漂移检测和变更集自动化
### D3 · 高弹性云解决方案 — 15%
**服务:** EC2 Auto Scaling, ALB / NLB / GWLB, Route 53 (health checks), CloudFront / WAF, RDS Multi-AZ, Aurora Global DB, DynamoDB Global Tables, S3 CRR / SRR, SQS DLQ / FIFO, Kinesis KDS / KDF, ElastiCache Redis, AWS Backup, DRS, Step Functions, SNS fanout
**构建内容:**
- Auto-scaling 模拟和基于 Docker 的蓝绿部署
- RDS 自动备份和快照
- S3 生命周期策略和版本控制
- 带有 Dead Letter Queues 的 SNS/SQS 扇出消息
- Step Functions DR 编排 (Pilot Light · Warm Standby · Active-Active)
### D4 · 监控与日志记录 — 15%
**服务:** CloudWatch Metrics / Alarms / Logs / Insights / Dashboards / Synthetics / Evidently / RUM, CloudTrail + Athena, X-Ray / ServiceLens, OpenSearch, Kinesis Firehose, Prometheus (AMP), Grafana (AMG), Container Insights, Lambda Insights, Trusted Advisor, Compute Optimizer
**构建内容:**
- CloudWatch 自定义指标、仪表板和复合告警
- 用于应用级可观测性的 Prometheus + Grafana 技术栈
- 集中式日志聚合和结构化日志分析
- EventBridge 自动化规则和 SNS 邮件/短信告警
- CloudWatch Contributor Insights 和异常检测
### D5 · 事件与应急响应 — 14%
**服务:** EventBridge rules, EventBridge Pipes, SSM Run Command, SSM Automation, Lambda remediation, Step Functions, GuardDuty, Security Hub, Inspector v2, Detective, OpsCenter, Incident Manager, SQS DLQ reprocess, SNS fanout, ChatBot (ChatOps)
**构建内容:**
- 在真实 AWS 上部署的 5 个 Lambda 自动修复函数
- 用于事件驱动自动化的 EventBridge 规则
- SSM 运行手册和 DR 运行手册自动化
- 安全组审计日志和 IAM 审计日志
- 关键模式:GuardDuty finding → EventBridge → Lambda 隔离 EC2
### D6 · 安全与合规 — 17%
**服务:** Control Tower, Landing Zone / AFT, SCPs (preventive), AWS Config rules, Organizations / OUs, IAM / STS / ABAC, KMS / CloudHSM, WAF / Shield Advanced, Macie, Secrets Manager, ACM / Private CA, Conformance Packs, RAM, SSO / Identity Center, Audit Manager, VPC Endpoints, PrivateLink
**构建内容:**
- 带有权限边界的 IAM 最小权限策略
- 用于静态数据加密的 KMS 和跨账户密钥管理
- CloudTrail 日志记录与分析;用于合规性审计的 AWS Config 规则
- 成本分配标签和账单告警
- 通过 Let's Encrypt 实现 NGINX 的 SSL/TLS
- VPC Flow Logs 和安全组审计
## 技术栈
| 类别 | 工具 |
|----------|-------|
| CI/CD | GitHub Actions, AWS CodePipeline, CodeBuild |
| 容器 | Docker, Docker Compose |
| IaC | Terraform, AWS CloudFormation |
| 计算 | EC2, Lambda (Python), Step Functions |
| 数据库 | RDS PostgreSQL, DynamoDB |
| 网络 | VPC, Subnets, Security Groups, NGINX |
| 监控 | CloudWatch, Prometheus, Grafana, EventBridge |
| 安全 | IAM, KMS, SSM, CloudTrail, Trivy, SonarCloud |
| 消息传递 | SNS, SQS, EventBridge |
| 存储 | S3 (artifacts, lifecycle policies, versioning) |
## 项目结构
```
aws-devops-platform/
├── .github/
│ └── workflows/ # GitHub Actions CI/CD pipelines
├── terraform/
│ ├── modules/ # Reusable Terraform modules
│ ├── workspaces/ # Multi-environment configs
│ └── remote-state/ # S3 backend + DynamoDB locking
├── cloudformation/
│ ├── vpc/ # VPC and networking templates
│ └── nested-stacks/ # Multi-environment nested stacks
├── lambda/ # Auto-remediation Lambda functions
├── monitoring/
│ ├── cloudwatch/ # Dashboards, alarms, custom metrics
│ └── prometheus-grafana/ # Prometheus config + Grafana dashboards
├── security/ # IAM policies, KMS configs, audit scripts
├── docs/
│ ├── architecture.png # Architecture diagram
│ ├── flow-diagrams/ # Domain flow diagrams (D84–D89)
│ └── cheatsheets/ # Quick reference cheat sheets
└── README.md
```
## 如何在本地运行
### 前置条件
- 已配置 AWS CLI (`aws configure`)
- Terraform >= 1.0
- Docker
- Python 3.9+
### 快速开始
```
# 克隆 repo
git clone https://github.com/suchithrachandrasekaran/aws-devops-platform.git
cd aws-devops-platform
# 初始化 Terraform
cd terraform
terraform init
terraform workspace new dev
terraform plan
# 部署到 LocalStack(用于本地测试)
export AWS_ENDPOINT_URL=http://localhost:4566
docker-compose up -d
terraform apply -var-file="envs/dev.tfvars"
```
## 构建日志
| 阶段 | 天数 | 里程碑 |
|-------|------|-----------|
| 基础设施 | D0–D3 | LocalStack, VPC, Docker |
| CI/CD | D4–D7 | 结合 GitHub Actions 的完整 pipeline |
| IaC | D8–D14 | Terraform + CloudFormation 完成 |
| 可观测性 | D15–D21 | CloudWatch + Prometheus + Grafana |
| 安全 | D22–D28 | IAM, KMS, 合规性监控 |
| Serverless | D29–D35 | Lambda, Step Functions, E2E 测试 |
| AWS 实战 | D36–D42 | 在真实 AWS Free Tier 上完整部署 |
| 弹性 | D43–D49 | 备份、生命周期、EventBridge |
| 合规性 | D50–D56 | CloudTrail, Config 规则, SSL/TLS |
| Sprint 9 | D57–D63 | DR 运行手册、DynamoDB、审计日志 |
| 回顾 | D64–D84 | 深入复习所有 6 个领域 |
| 最终阶段 | D85–D92 | 流程图、架构图、小抄 |
## 关键交付物
- **6 个领域流程图** — 每个考试领域的可视化映射
- **平台架构图** — 端到端系统视图
- **2 份小抄** — 浓缩的考试与实战参考资料
- **5 个 Lambda 函数** — 部署在 AWS 上的真实自动修复功能
- **完整的 IaC** — 每个资源均使用 Terraform 或 CloudFormation 定义
- **零 AWS 支出** — 100% 符合 Free Tier 规范
标签:AWS, DPI, 基础设施, 自动化运维, 自定义请求头, 请求拦截