How to set up and use Pub/Sub Notifications for Cloud Storage?

0 votes
I want to set up and use Pub/Sub Notifications for Cloud Storage, so that I can track changes to your Cloud Storage objects. How can I set this up?
Nov 21, 2019 in GCP by anonymous
• 9,500 points
228 views

1 answer to this question.

0 votes

The following steps add a notification configuration to your bucket that sends notifications for all supported events. 

To send notifications for a subset of events, include the -e flag with your gsutil command or the event_types key in the body of your JSON request.

Here's how you can do it using gsutil:

Use the gsutil notification create command, replacing [VALUES_IN_BRACKETS] with the appropriate values:

gsutil notification create -t [TOPIC_NAME] -f json gs://[BUCKET_NAME]

If you use a [TOPIC_NAME] that doesn't exist in your project, gsutil creates one for you.

answered Nov 21, 2019 by Sirajul
• 50,480 points

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

Set up log delivery for a cloud storage bucket.

The following steps describe how to set ...READ MORE

answered Nov 22, 2019 in GCP by Sirajul
• 50,480 points
70 views
+2 votes
2 answers

How to download multiple files in Google Cloud Storage?

You can achieve this through the gsutil ...READ MORE

answered May 9, 2018 in GCP by kurt_cobain
• 9,310 points
7,811 views
0 votes
1 answer

GCP Error: 403: Access Denied

Check that your credentials are correct. For ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 50,480 points
163 views
0 votes
1 answer

Permissions issue with Google Cloud Storage Bucket.

You can regain access to the object by assigning an applicable role, like roles/storage.objectAdmin, to ...READ MORE

answered Oct 10, 2019 in GCP by Sirajul
• 50,480 points
503 views
0 votes
1 answer