Files
nexus/wiki/sources/how-to-simplify-multi-account-deployments-monitoring-centralized-logs-for-aws-cloudformation-stacksets.md
2026-04-20 00:02:56 +08:00

3.0 KiB
Raw Blame History

title, type, tags, date
title type tags date
How to Simplify Multi-Account Deployments Monitoring:Centralized Logs for AWS CloudFormation StackSets source
aws
cloudformation
stacksets
multi-account
centralized-logging
eventbridge
cloudwatch
2025-10-25

Source File

Summary

  • 核心主题AWS 多账号环境下 CloudFormation StackSets 部署监控的集中化日志解决方案
  • 问题域:多账号基础设施部署的可观测性
  • 方法/机制EventBridge 跨账号事件转发 + CloudWatch Logs 集中存储
  • 结论/价值:实现单一管理界面监控跨账号的 CloudFormation 部署事件

Key Claims

  • StackSets 支持跨多个账号和区域部署基础设施,但缺乏集中监控能力
  • 通过 EventBridge 规则捕获目标账号的 CloudFormation 事件
  • 跨账号事件转发至管理账号的集中式事件总线
  • CloudWatch Logs 提供统一的日志存储和查询能力

Key Quotes

"When a critical security baseline deployed across 50 accounts suddenly starts failing, teams face the daunting task of logging into each account individually to understand what went wrong and which accounts were affected."

Key Concepts

Key Entities

Connections

Contradictions

Cost Implications

实施集中式监控解决方案时需考虑以下成本组件:

  • Amazon EventBridge 定价:跨账号发布事件到中央事件总线的相关费用
  • Amazon CloudWatch 定价:存储来自所有账号的 CloudFormation 事件的集中日志组的存储费用,以及查询集中日志的费用
  • AWS Key Management Service 定价:用于日志加密的客户管理密钥的相关费用

Clean up

清理本方案创建的资源的步骤:

  1. 首先从 AWS CloudFormation 控制台在管理账号中删除通用资源堆栈集common-resources-stackset。这将删除部署到所有成员账号的资源。
  2. 堆栈集操作完成后删除管理账号日志设置堆栈log-setup-management以移除集中式日志基础设施包括事件总线、日志组和关联的 IAM 角色。

注意:在删除管理账号日志设置之前,确保所有堆栈集操作已完成,以确保正确清理所有资源。