I’m trying to set up my node pool resources for GKE, so that whenever I make a change to them that requires them to be recreated, it automatically first creates the new node pool before destroying the old one.
In order to achieve this I need to have some kind of random generation in order to make sure that the names for the node pools are unique. I’ve tried doing this with the random resource, but the problem is that the random identifier does not change when a force update to a resource is done, as the random id resource itself has not changed.
I read that the ‘name_prefix’ property is deprecated and should not be used for this purpose (although it seems to fit my needs perfectly).
What would according to you be the best way to model this in Terraform?