- A parent (root) stack contains one or more nested (child) stacks.
- Each nested stack is represented in the parent template by an AWS::CloudFormation::Stack resource.
- The parent stack controls creation and updates for its child stacks, preserving correct ordering and dependency handling.

- When you update the parent stack, CloudFormation evaluates changes and orchestrates updates to the nested stacks in the correct order.
- Each nested stack exists as its own stack object in CloudFormation, but you typically drive lifecycle operations (create, update, delete) from the parent.
- If a nested-stack change fails, CloudFormation can roll back that nested stack to prevent inconsistently applied resources; however, a failed nested-stack update during a parent update can cause the parent update to fail and roll back as well.
Update nested stacks by updating the parent stack. Doing so lets CloudFormation manage dependencies, ordering, and safe rollbacks across nested stacks. Keep nested templates focused on a single concern (for example: networking, IAM, storage) to maximize reuse.
| Benefit | Description |
|---|---|
| Modularity | Split large templates into focused templates (network, compute, storage) for readability and reuse. |
| Reuse | The same nested-template file can be referenced by multiple parent stacks to produce independent child stack instances. |
| Controlled updates | Parent-driven updates ensure nested stacks are updated in the right order with dependency handling. |
| Failure isolation | Nested stack failures can be rolled back to avoid partially applied nested-template resources — though a failing nested update can still fail the parent operation. |
Nested stacks are tightly coupled to their creating parent. You cannot reparent an existing nested stack to a different parent. If you need a stack shared across parents, deploy it as an independent stack (not a nested child) and reference it externally.
- Use nested stacks when a template becomes large or has repeatable sections you want to reuse.
- Avoid nesting everything: deeply nested or highly interdependent nested stacks can add complexity. Prefer clear boundaries and minimal coupling between nested stacks.