---
title: "How to Simplify Multi-Account Deployments Monitoring: Centralized Logs for AWS CloudFormation StackSets"
type: source
tags: [AWS, CloudFormation, DevOps, Multi-Account, EventBridge, CloudWatch]
date: 2025-10-24
---

## Source File
- [[raw/Cloud & DevOps/How to Simplify Multi-Account Deployments Monitoring Centralized Logs for AWS CloudFormation StackSets.md]]

## Summary
- 核心主题：多账号 AWS 环境下 CloudFormation StackSets 部署监控的集中化日志解决方案
- 问题域：多账号架构中跨账号部署的可观测性和故障排查挑战
- 方法/机制：通过 EventBridge 跨账号事件转发 + CloudWatch Logs 集中日志存储实现单一管理界面监控
- 结论/价值：解决多账号部署时的日志分散问题，提供统一监控面板和查询能力

## Key Claims
- 多账号策略可提升安全性和治理能力，但会增加运维复杂度
- EventBridge 跨账号事件转发机制可实现集中化日志收集
- CloudWatch Logs Insights 可提供跨账号查询分析能力
- 解决方案需满足 AWS Organizations、StackSets 信任访问等前置条件

## 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."

> "Our solution creates a centralized logging system that collects AWS CloudFormation events from all target accounts and forwards them to a central management account."

## Key Concepts
- [[Multi-Account Strategy]]：多账号策略，通过分离工作负载提升安全性和治理能力
- [[EventBridge]]：AWS 事件路由服务，支持跨账号事件转发
- [[CloudWatch Logs]]：AWS 日志存储和分析服务
- [[StackSets]]：CloudFormation StackSets，支持跨账号和跨区域部署

## Key Entities
- [[AWS]]：云服务提供商，提供 EventBridge、CloudFormation、CloudWatch 等服务
- [[CloudFormation]]：AWS IaC 服务，StackSets 是其跨账号部署功能

## Connections
- [[AWS]] ← 提供 ← [[CloudFormation]]
- [[AWS]] ← 提供 ← [[EventBridge]]
- [[AWS]] ← 提供 ← [[CloudWatch Logs]]
- [[CloudFormation]] ← 使用 ← [[StackSets]]

## Architecture Components
1. **Management Account**：创建中央事件总线和日志组
2. **Target Account**：部署 EventBridge 规则转发 CloudFormation 事件
3. **Resource Deployment**：StackSets 部署通用资源生成监控事件
4. **Monitoring**：CloudWatch Logs Insights 提供查询分析

## Implementation Templates
- `log-setup-management.yaml`：管理账户日志基础设施模板
- `common-resources-stackset.yaml`：示例资源 StackSet 部署模板

## Cost Components
- Amazon EventBridge：跨账号事件发布费用
- Amazon CloudWatch：日志存储和查询费用
- AWS KMS：客户管理密钥加密费用