Create random but valid configuration automatically

Terraform noob here.
Is it possible to create instances with some randomness?
The plan is to create virtual machines at different cloud providers like AWS, Digitalocean etc. Most providers have different regions/zones available.
I need to create VM’s in random regions but with the same OS and instance type (specific to the provider)

Terraform seems to know already which combinations are valid i.e. you can’t spin up instance type A on provider B .
Can you automatically create a valid configuration with random regions + other clearly defined variables?
Today I want to spin up VM’s in region A,B,C tomorrow on B,E,H …
Is that possible?