Demo:为 PR 总结 Terraform 资源关系
有用的 Terraform 图应该说明这次变更涉及哪些基础设施,以及资源如何关联,让 reviewer 在打开完整 module 前就有上下文。
- 按 provider 或 module 分组资源。
- 标出公网入口和安全边界。
- 审批前对照 terraform plan。
resource "aws_lb" "app" {}
resource "aws_security_group" "web" {}
resource "aws_ecs_service" "api" {
load_balancer {
target_group_arn = aws_lb_target_group.api.arn
}
}
resource "aws_rds_cluster" "main" {}