March 2019
Beginner to intermediate
778 pages
34h 20m
English
Going back to the hello-gce instance we created earlier, let's provide it with both project-wide metadata and instance-specific metadata. Suppose we want several VMs to have access to a Pub/Sub topic alerting services that a customer order has been placed. In order to tell them all what that Pub/Sub topic is, we can set a project-wide property of cust_order_pubsub_topic with a value of customer-orders. From within the Cloud Shell, run the following command:
gcloud compute project-info add-metadata --metadata \ cust_order_pubsub_topic=customer-orders
We can check that our hello-gce instance has received the update with the following command:
gcloud compute ssh --zone=us-east1-b hello-gce --command \'curl -s -H "Metadata-Flavor: ...
Read now
Unlock full access