1 Answers
Hello! It definitely is possible to pass the script by reference, like this, but you have to be very careful about how you provide the info–and make sure it’s readable, as Jolly noted in a comment. Check out this link for more info about this.
The simplest test would be to pass the public link to my script in github: https://raw.githubusercontent.com/ACloudGuru/gcp-cloud-engineer/master/compute-labs/worker-startup-script.sh
If you get that working, next try a link to a public GCS object you control. Then maybe try a private object that is accessible by the service account + scopes that you grant to the instance.
Cheers!
Mattias
I did the same and it did not work for me too. So may be it is not possible, or some other workaround is required to do this.
Did your instance have a scope or service account that allowed it to read from the bucket? You could also use the startup-script-url to point to the external http url. The script does not have to be a google storage bucket. This has the advantage of not needing any IAM permissions to reach it. This worked for me.