Hi abah-james - I had a play with this and I think I have a Bash workaround for you until the https://github.com/Azure/aztfy/issues/28 enhancement comes in.
It is a Bash workaround for merging two aztfy outputs. Assumes:
- You have used aztfy on two resource groups (e.g. rg1 and rg2)
- All Terraform identifiers (i.e.
terraform state list outputs) are unique across the state files
terraform validate is OK on each input config
mkdir union
cp -pr rg1/.terraform* rg1/provider.tf union
sed 's/^}$/}\n/g' rg1/main.tf rg2/main.tf > union/main.tf
jq -s '(.[0]|del(.resources)) + {resources: (.[0].resources + .[1].resources)}' rg1/terraform.tfstate rg2/terraform.tfstate > union/terraform.tfstate
(Sed only used as aztfy doesn't currently add a newline at the end of each block, so cat makes invalid HCL. The jq takes the keys from the first file except resources, then concats the two resources into the new terraform.tfstate.)