google-cloud-platformgoogle-compute-engine

Is there a way to know the creator of a GCP instance with gcloud SDK?


I am trying to find a gcloud command that can provide information about the creator of an instance. Is there a way to achieve that?


Solution

  • Yes, See below and replace the [instance name] accordingly.

    gcloud logging read "resource.type=gce_instance AND jsonPayload.event_subtype=compute.instances.insert AND jsonPayload
    .resource.name=[instance name]" | grep user