How to assign multiple "ip_configurations" to one NIC in Azure VMSS without hard code?

I’m trying to use Terraform to provision my vmss. I need around 40 ip configurations to be assigned to a sungle network interface of the vmss. I tried to use ‘count’ but this “ip_configuration” is a dependent resource hence it failed. Any idea how to do it without hard code?