fix(cloudformation): propagate nested stack failure status reason and cover changeset rollbacks (#3921)

When a nested stack fails with no status reason of its own, as after an
UPDATE_ROLLBACK_COMPLETE, the parent's ChildStack event now says the
nested stack rolled back or failed with its terminal status instead of
"failed: null". Cover the changeset create and update rollback paths,
asserting the parent's ResourceStatusReason, and restore the @Test on
the nested-output regression test.
This commit is contained in:
Vũ Thế Huy authored and GitHub committed 2026-09-21 22:20:41 -05:00
1 parent ee4acfdf81
commit a5254defb6
2 files changed
+217 -1

No files matched your search

@@ -2418,7 +2418,13 @@ public class CloudFormationService implements ResourceProvider {
resource.setStatus("CREATE_COMPLETE");
} else {
resource.setStatus("CREATE_FAILED");
resource.setStatusReason("Nested stack " + childStackName + " failed: " + childStack.getStatusReason());
String reason = childStack.getStatusReason();
if (reason == null || reason.isBlank()) {
reason = "Nested stack " + childStackName + " rolled back or failed with status " + childStack.getStatus();
} else {
reason = "Nested stack " + childStackName + " failed: " + reason;
}
resource.setStatusReason(reason);
}
return resource;