Files
nexus/wiki/sources/learning-sessions-cloud-transformation-programme-deploying-rds-via-terraform.md
2026-05-03 05:42:12 +08:00

62 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Learning Sessions Cloud Transformation Programme-Deploying RDS via Terraform"
type: source
tags:
- Terraform
- RDS
- IaC
- Cloud-Transformation-Programme
- DBRE
date: 2026-04-14
---
## Source File
- [[Cloud & DevOps/Public-Cloud-Learning-Sessions/03_Terraform/learning-sessions-cloud-transformation-programme-deploying-rds-via-terraform]]
## Summary用中文描述
- 核心主题:通过 Terraform 在 AWS 上自动化部署 RDS 数据库DBRE 团队的 Greg 主讲
- 问题域IaC 部署 RDS 的模块选型、Day 2 运维操作、监控告警配置
- 方法/机制:推荐使用 Gruntwork 的 RDS Service 模块(含 KMS 加密、CloudWatch 告警),配合 Terragrunt 管理多环境配置Day 2 操作通过 GitHub PR + Atlantis 审批后自动 apply
- 结论/价值:任何规模的 RDS 部署都应使用 Terraform 而非 ConsoleIaC 的核心价值在于"代码即文档"
## Key Claims用中文描述
- **GregDBRE 团队)× IaC 选型**:提倡所有规模的 RDS 部署都使用 TerraformConsole 方式不可取
- **IaC 六大核心价值**:速度、灵活性、一致性、灾难恢复、文档化、自动化;"代码即文档"是最核心的文档化原则
- **RDS 模块二选一**grunt work RDS Service推荐功能完整vs SRE Core Modules功能较少grunt work 预置 KMS 加密 + CloudWatch 告警SRE 模块无此能力
- **Terragrunt 实践**:使用 tagged release不用 master确保稳定性避免变量重复声明代码保持 DRY
- **Day 2 运维流程**:变更在 Terragrunt 文件中完成 → GitHub Pull Request → Atlantis 审批 → 自动 apply支持扩缩容、打补丁、主版本升级
- **监控策略**CloudWatch Dashboard + 告警burstable 实例需关注 CPU credits
## Key Quotes
> "We use Terragrunt, which is basically it's a wrapper around Terraform, and it allows you to keep your code clean and you're not repeating your variables all the time." — Greg, DBRE Team
> "The code is the documentation." — Greg, DBRE TeamIaC 核心哲学)
## Key Concepts
- [[Infrastructure-as-Code]]IaC 是本次分享的主题Terraform 是核心工具,覆盖速度/灵活性/一致性/灾难恢复/文档化/自动化六大价值
- [[InfrastructureAsCode]]:页面已有,本次来源提供 IaC 选型 RDS 的具体实践补充
- [[DRY-Principle]]Terragrunt 践行 DRY 原则,避免变量在多环境间重复声明
- [[Terraform-State]]Terraform 通过状态文件将期望状态绑定到实际环境(本来源提及但未展开)
## Key Entities
- [[Greg]]DBRE 团队成员,本次 Learning Session 的讲师,主讲 Terraform 部署 RDS
- [[Amazon-RDS]]本次分享的核心资源Greg 主张所有规模都用 Terraform 部署
- [[Gruntwork]]:提供 RDS Service 模块和 SRE Core Modules是本次分享的模块选型依据
- [[Terragrunt]]:推荐的 Terraform 封装工具,使用 tagged release 管理多环境
- [[AWS]]RDS 所在的云平台,监控使用 CloudWatch
- [[Atlantis]]GitOps 工具,配合 GitHub PR 实现 RDS 变更的自动化审批和 apply
## Connections
- [[ctp-topic-48-terraform-vs-terragrunt]] ← related_to ← [[learning-sessions-cloud-transformation-programme-deploying-rds-via-terraform]](两者均讨论 Terragrunt 选型,本来源侧重 RDS 场景下的实践)
- [[ctp-topic-3-deploy-and-maintain-infrastructure]] ← depends_on ← [[learning-sessions-cloud-transformation-programme-deploying-rds-via-terraform]](基础设施部署与维护是本来源的上下文)
- [[ctp-topic-32-using-atlantis-cicd-for-infrastructure-deployments]] ← extends ← [[learning-sessions-cloud-transformation-programme-deploying-rds-via-terraform]]Day 2 运维中 GitHub PR + Atlantis 自动 apply 与该来源的 Atlantis 配置细节互补)
- [[ctp-topic-9-ci-cd-with-gruntwork]] ← related_to ← [[learning-sessions-cloud-transformation-programme-deploying-rds-via-terraform]](两者均涉及 Gruntwork 模块体系)
- [[learning-sessions-cloud-transformation-programme-20230808-183322-meeting-recordi]] ← extends ← [[learning-sessions-cloud-transformation-programme-deploying-rds-via-terraform]]ECS 部署和 RDS 部署共同构成 CTP 的 IaC 全景)
## Contradictions
- 与 [[ctp-topic-48-terraform-vs-terragrunt]] 的潜在冲突:
- 冲突点Terraform vs Terragrunt 的定位
- 当前观点来源Terragrunt 是 RDS 部署的首选工具,"keep your code clean, not repeating variables"
- 对方观点CTP Topic 48 对 Terraform 和 Terragrunt 的适用场景做了更细致的对比,指出 Terragrunt 是"轻量封装"而非必须选择
- 实际情况:两者不矛盾,本来源是 Terragrunt 的正面用例Topic 48 提供的是通用对比框架