Creation of an a priori unknown number of subscriptions with associated resource groups

How would you proceed with terraform/azurerm if you were given an a priori unknown list of subscription names (via terraform.tfvars) and asked to create a corresponding subscription with an associated resource group (under that subscription) for each of those names?