- Projects/
- AWS DevOps Pro Certification/
- 2: Configuration Mgmt / Infrastructure as Code/
- 2: CloudFormation/
6: Nested Stacks / Cross-stack refs
·1 min
Table of Contents
Why nested stacks?
- Modularity
- Reusability
- Reuse smaller chunks of template in (perhaps hundreds of) parent templates
- More OOP-style
Why cross-stack refs?
- Get diff teams working on different template files
- Export values from one stack to another related one
- More API-style
How?
Nesting:
- Use
AWS::CloudFormation::Stack
resource
Cross-stack:
- Use cross-stack refs;
- Use “output” section of templates
- Use
Fn::ImportValue
to import outputs