Azure management group associations for multiple subscriptions in one state file

So i have a scipt working where I specify the new subscription that has been created and then associates to a management group.
the guts of this is here:
#brings the management group to be included into this script
data “azurerm_management_group” “parent” {
name = var.management_group_name

#brings the new subscription to be included into this script
data “azurerm_subscription” “newea” {
subscription_id = var.new_subscription_id

resource “azurerm_management_group_subscription_association” “sub_to_mg” {
management_group_id =
subscription_id = “/subscriptions/${data.azurerm_subscription.newea.subscription_id}”

Now what I am trying to do is do this for multiple subscriptions as they are created all in the same state file.
however with the above script, when I change the variable such as “new_subscription_id” it then thinks we are still talking about the same “sub_to_mg” resource and then goes and removes the old subscription from said management group as I am trying to associate multiple subscriptions into different (or sometimes the same) management group.
Have tried multiple things now to get this working as I hoped but cant seem to find a way to get it working other than the multiple resource instances mentioned above.