Nested CloudFormation Stack Rollback

Viewed 170

In a Nested Stack setup -

  1. I have the following - Root Stack, Nested Stack 1, Nested Stack 2.
  2. Nested Stack 2 is referencing an output variable from Nested Stack 1

Question: If my Nested Stack 1 is successfully created, but Nested Stack 2 encounters an issue, both the stacks are rolled back. Is there a way only the failed stack is rolled back?

1 Answers

Sadly there is not. Parent stack + nested stacks are considered as a one entity. If anything fails, everything is rolled back.

If you want to have them be separate, then do not nest your stacks. Instead extract nested resources to their own stacks and export their outputs, so that other stacks can import them. Alternatively, pass the outputs as inputs to the other stacks.

Related