Kamil Janowski
Kamil Janowski

Reputation: 2025

Google Cloud Role to access specific pub/sub topic

Is it possible to specify a Role in such a way that it allows you to listen to a very specific Pub/Sub topic rather than all of them?

Upvotes: 1

Views: 150

Answers (1)

Jofre
Jofre

Reputation: 3898

Roles apply to a resource, so the most adequate question would be "Can a policy be set into a Pub/Sub resource?"

The answer is yes, and it's done through the Pub/Sub API method projects.topics.setIamPolicy. To that endpoint, you must pass a policy, which will allow you to set bindings for the roles Owner, Editor, or Viewer.

Upvotes: 1

Related Questions