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 in GCP by anonymous
• 6,650 points

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 by Sirajul
• 40,980 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 in GCP by Sirajul
• 40,980 points
+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,280 points
0 votes
1 answer

GCP Error: 403: Access Denied

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

answered Oct 9 in GCP by Sirajul
• 40,980 points
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 in GCP by Sirajul
• 40,980 points