💾 Archived View for cfdocs.wetterberg.nu › resource-import-nested-stacks.gemini captured on 2024-05-12 at 16:00:27. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-03)

-=-=-=-=-=-=-

Nesting an existing stack

Search

Use the `resource import` feature to nest an existing stack within another existing stack. Nested stacks are common components that you declare and reference from within other templates. That way, you can avoid copying and pasting the same configurations into your templates and simplify stack updates. If you have a template for a common component, you can use the `AWS::CloudFormation::Stack` resource to reference this template from within another template. For more information on nested stacks, see Working with nested stacks.

Working with nested stacks

AWS CloudFormation only supports one level of nesting using `resource import`. This means that you cannot import a stack into a child stack or import a stack that has children.

Nested stack import validation

During a nested stack import operation, AWS CloudFormation performs the following validations.

Nest an existing stack using the AWS Management Console

DeletionPolicy

stack-level tags

Nest an existing stack using the AWS CLI

DeletionPolicy

stack-level tags

It's not necessary to run drift detection on the parent stack after this import operation because the `AWS::CloudFormation::Stack`resource was already managed by AWS CloudFormation.