2 Answers
You can use –metadata startup-script-url=URL
There is also –metadata-from-file but I could not get it to work for a file in the gcloud CLI home dir
You need to add the option as mentioned in the doc:
https://cloud.google.com/compute/docs/instances/startup-scripts/linux#passing-local
For example:
–metadata-from-file=startup-script=worker-startup-script.sh
I used this:
gcloud compute instances create challenger3 –image-project=debian-cloud –image-family=debian-10 –scopes=storage-rw –metadata=startup-script-url=gs://billstestbuck2021/startupcli.sh
but it maybe too much permissions