How to Connect Pipedream with Google Cloud and Set Permissions?

This topic was automatically generated from Slack. You can find the original thread here.

Hi! Are there any docs on how to connect Pipedream with Google Cloud? I’m not sure what permissions to set, etc. The below is unfortunately not very helpful

The reason we reference Google’s docs in that screen is because you can connect to any Google API from Pipedream. Google Cloud doesn’t provide a one-click way to authorize specific apps via OAuth in the same way as other SaaS apps. In short, we wish this were easier too!

Given the needs of your workflow (i.e. the services you need to connect to from Pipedream), you should set the minimum permissions on the Google service account, and you’ll be able to export the credentials as JSON that you can add here.

Thanks for the quick response here – I tried setting it up for Pub/Sub with Gmail but got this error. Any chance you know what I’m doing wrong?

It looks like the IAM role associated with the service account key doesn’t have the right permissions. What Pipedream trigger / action is this error associated with? I can show you the code we use to connect to Google and you can map that to the permissions you need

It’s associated with New Pub/Sub Messages and this is how I set the role (could be wrong as I’m learning as I go)

Are you seeing that error when you try to select a specific field, or when you click Deploy on the trigger? I’d love to see exactly what triggered that error

I believe it was when I selected “Create Source”

Side note: I already have a subscription, so I wasn’t sure why I needed to make a new pub/sub topic

You’ll notice if you set the Type to “existing”, we’ll let you load existing topics from your account

Re: the permissions, take a look at these PubSub IAM docs. Here’s the code for the source. If you’re using an existing pub sub topic, it looks like you’ll just need permissions to list topics and create subscriptions on a topic

Re: New/existing – I thought that “new” was get new messages from Pub/Sub while “existing” was a backfill. My bad! Switching that up now

I added this permission, which is the only pub/sub related permission that I could find, but it’s still not allowing me to see existing topics.

Screenshot 2023-10-19 at 7.30.12 PM.png

do you see these roles? e.g. try finding roles/pubsub.editor

looks like you can probably create a custom role with these permissions, too:

pubsub.topics.list
pubsub.subscriptions.create

I am not 100% sure how our API calls map 1:1 with Google permissions, but hopefully that helps

Ahhh ok! So I apparently had to go and add the service account to our IAM and then create a separate role there. Thank you – it should work now

Also wow just realized that you’re the founder – really impressed with the Friday evening support!

no problem! Glad that worked