Reputation: 53
Background: I've Cloud Storage bucket in Project A and All other compute services in Compute Project B.
The requirement is to create a Cloud Function and Pub/Sub Notification in Storage project B.
Steps in plan are:
Q: Is it possible to create storage notification from Project B for Cloud storage residing in Project A? How can we do that ? Also I want to have this event to be sent to Cloud Function later, how can we do that ?
Appreciate your help!!
Upvotes: 1
Views: 1150
Reputation: 38369
Yes, you can! It works the same as setting it up within one project, but you need to specify the project IDs.
gsutil mb -p project-a -l location gs://bucket-name
gcloud pubsub topics create projects/project-b/topics/topic-name
# Assuming here that caller has permissions to both projects.
gsutil notification create \
-f json \
-t projects/project-b/topics/topic-name \
gs://bucket-name
Upvotes: 4