Skip to content

Pub/Sub: IAM Permissions Required to Subscribe Unclear #1502

@MarkHerhold

Description

@MarkHerhold

If I create an IAM service account with the View and Subscribe roles, I am unable to subscribe to an existing topic in pub/sub. It seems I must use an admin role. Some clarification on the roles required to do various things would be nice. I'm not sure if the issue is being cause by the node client or if I am actually missing roles that are needed.

Environment details

  • OS: Mac OSX
  • Node.js version: v6.3.0
  • npm version: 3.10.3
  • @google-cloud/pubsub version: 0.1.1

Steps to reproduce

const pubsub = require('@google-cloud/pubsub');

const JOB_QUEUE = 'new_job';

const pubsubClient = pubsub({
    projectId: 'myproject-goes-here',
    keyFilename: '/Users/Mark/creds.json'
});

const newJobTopic = pubsubClient.topic(JOB_QUEUE);

newJobTopic.subscribe(JOB_QUEUE, {
    reuseExisting: true
}, function(err, subscription) {
    console.error(err); // Error: User not authorized to perform this action.
});

If I create a service account that has an admin pub/sub role, I can connect to the service as expected.

Metadata

Metadata

Labels

api: pubsubIssues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions