Naruto77
Naruto77

Reputation: 33

How do I find the owner of a Google Cloud Storage object

My App Engine is run by a service account. It writes files to a bucket. How can I see the service account as owner of the file objects?

Upvotes: 1

Views: 5862

Answers (2)

tomodachi
tomodachi

Reputation: 306

You can use the "new" gcloud storage command which supersedes gsutil while implementing all of the gsuil features.

gcloud storage ls -L gs://your-bucket/your-object

Upvotes: 1

TasosZG
TasosZG

Reputation: 1294

You can use the gsutil ls command with the -L option:

gsutil ls -L gs://your-bucket/your-object

This will print the entities which have permissions on the object. One of them will be the service account which created the object:

{

"email": "[email protected]",

"entity": "[email protected]",

"role": "OWNER"
}

Also from the console in the bucket's page if you click on the 3 dots at the right side of the object and "edit permissions" you will see the same entitites.

Upvotes: 4

Related Questions