Selecting a datastore cluster or compute cluster based on free space, available memory

I don’t see any method to iterate through all available datastore clusters or compute clusters and choose to deploy a Vm to the cluster with the most space or most available RAM. This is simple with Powercli. Is there no method to do this with Terraform?