rootId property
For nested stacks--stacks created as resources for another stack--the stack ID of the top-level stack to which the nested stack ultimately belongs.
For more information, see Working with Nested Stacks in the AWS CloudFormation User Guide.
Implementation
final String? rootId;