Skip to Content
Google Cloud Platform for Architects
book

Google Cloud Platform for Architects

by Vitthal Srinivasan, Loonycorn Ravi, Judy Raj
June 2018
Intermediate to advanced
372 pages
8h 44m
English
Packt Publishing
Content preview from Google Cloud Platform for Architects

Startup scripts

We can run our own startup scripts from VM instances to perform automatic actions such as updating the system, and sending notifications and so on.

A startup script is specified using metadata keys through the metadata server and can be applied using the console or gcloud command line:

  1. Once you have set the default region and zone for your instance, you can provide a startup script using the gcloud command line while creating an instance. The script is provided with a—metadata flag:
    gcloud compute instances create example-instance --tags http-server 
    --metadata startup-script='#! /bin/bash
    # Installs apache and a custom ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google Cloud Platform Professional Cloud Architect

Google Cloud Platform Professional Cloud Architect

Victor Dantas
Google Cloud Platform for Developers

Google Cloud Platform for Developers

Ted Hunter, Steven Porter

Publisher Resources

ISBN: 9781788834308Other