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.
If I create an IAM service account with the
ViewandSubscriberoles, I am unable to subscribe to an existing topic in pub/sub. It seems I must use anadminrole. 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
Steps to reproduce
If I create a service account that has an admin pub/sub role, I can connect to the service as expected.