Your organization has 500+ CloudFormation stacks across 30 accounts. Deployments are slow, template reuse is poor, and teams duplicate infrastructure patterns. How do you redesign for large-scale CloudFormation management?
Quick Answer
Implement a layered architecture with shared template modules in S3, Service Catalog for governed self-service, StackSets for cross-account baselines, CI/CD pipelines per stack with change set reviews, and CloudFormation Registry for custom resource types and modules.
Detailed Answer
Template Modularization
Create a central S3 bucket (versioned, encrypted) containing reusable nested stack templates: VPC-with-flow-logs, ECS-cluster-with-capacity-providers, RDS-with-monitoring, Lambda-with-tracing. Version templates using S3 object versioning and reference specific versions in parent stacks. This eliminates copy-paste duplication and ensures security standards are baked into shared templates. Use CloudFormation modules (registered in the CloudFormation Registry) for smaller reusable patterns that don't warrant a full nested stack.
AWS Service Catalog
For self-service provisioning, publish CloudFormation products in Service Catalog. Each product is a governed template with IAM constraints, parameter validation, and approved configurations. Application teams launch products from the catalog without needing CloudFormation expertise or broad AWS permissions. Products can be shared across accounts via portfolio sharing. This provides the guardrails organizations need at scale.
CI/CD Pipeline Architecture
Implement GitOps for CloudFormation: templates live in Git, PRs trigger linting (cfn-lint), policy validation (cfn-guard), and change set creation. Reviewers see the change set diff in the PR. Merging to main triggers change set execution. Use CodePipeline with manual approval gates for production stacks. Implement drift detection on a schedule and alert when stacks drift from their templates.
Performance Optimization
For large stacks, split by lifecycle and blast radius. Use concurrent stack deployments in CI/CD where stacks are independent. Implement resource import to bring existing resources under CloudFormation without recreating them. Use CloudFormation hooks for pre-create/pre-update validation. Tag all stacks consistently for cost attribution and operational management.