I have created a main template that deploys to a resource group (parent-rg). Inside the main template, there are multiple nested templates within it. The nested templates have the option to create their resources in a different resource group (child-rg).
Naturally, during deploying, if the child-rg does not exist, the nested template will fail.
Is there a way to put a logical expression to say "if your child-rg does not exist, place it in the main template's parent-rg."