Run script on first vm defined after all

i have 1 master vm and then 2 vm. how can run shell script on master vm after all 3 vm up?

To run a script on the first VM defined after all other VMs have been defined in a configuration management tool like Terraform, you can use the depends_on attribute or use the count meta-argument along with the index function to determine the index of the first VM GPT66X and then conditionally run the script on that VM.