O'Reilly logo

Google Cloud Platform Cookbook by Legorie Rajan PS

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To create the automated alerts when a user creates an instance outside our region of choice (us-west1), we'll need to perform two steps. Firstly, we'll have to create custom metric to identify the breach event. Next, we'll create an alerting policy in Stackdriver Monitoring to send us a notification when the conditions of the custom metric are met:

  1. Navigate to the Stackdriver Logging in the GCP Console.
  2. In the resource dropdown, select GCE VM Instance, which will show us all logs related to VMs:
If you don't have any logs for VM creation in your project, create a test VM to generate the activity logs.
  1. From the drop-down, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required