Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Startup Script

Just started the Hands-on GCP, In a way just want to understand that are these startup scripts are pre-defined/manually created or get automatically created in a project. I am not able to view any if I create any project.


I think we need to create and then give that script at the time of instance creation. Then it will start executing once that particular instance started.

1 Answers

A startup script is simply a script with commands to be executed when the OS of a GCE instance finishes its boot procedure. Content of this startup script of course must be "understandable" and "executable" by the OS inside that GCE instance.

That said, you must manually define the content of startup script per your own need.

There are basically 3 ways of loading a startup script:

  • Directly paste the content into startup script field when you create GCE instance with Console (web interface)

  • Load the content from a locally-stored file, usually used when you create GCE instance with Cloud SDK (the gcloud command).

  • Load the content from an object stored in a GCS bucket. This is the only way if you want to use a startup script whose size is more than 256 KB.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?