Google Pub Sub prerequisites¶
Introduction¶
These are the prerequisites for using the Google Pub Sub connector with a Google Pub/Sub instance:
Create a service account and grant roles¶
Follow these steps to create a service account and grant roles to provide access to the Google Cloud project to be used with the Google Pub Sub connector:
-
Select a project in the Google Cloud Console.
Note
Ensure the Google Pub/Sub API is enabled for the selected project.
-
In the navigation menu, navigate to IAM & Admin > Service Accounts.
-
Click Create Service Account, located along the top of the page.
-
Enter the Service account details:
-
Service account name: Enter any string for the service account name.
-
Service account ID: This field is automatically populated to match the Service account name and can be edited, if desired.
-
Service account description: Enter a description for the service account.
-
-
Click Create and Continue.
-
Assign a role to allow access to the project (required for a successful connection in the Google Pub Sub connector):
-
Role: Using the dropdown, select the appropriate Pub/Sub role or custom role for your use case, then click Continue.
When using predefined Google Pub/Sub roles, these are the role combinations that can be granted to the service account to allow access to each Google Pub Sub activity:
Activity Google Pub/Sub Roles Acknowledge message Pub/Sub Admin or
Pub/Sub SubscriberCreate topic Pub/Sub Admin or
Pub/Sub Editor or
Pub/Sub Lite Admin or
Pub/Sub Lite EditorGet message Pub/Sub Admin or
Pub/Sub Subscriber and Pub/Sub Viewer (both are required if the Pub/Sub Admin is not being used)Publish message Pub/Sub Admin or
Pub/Sub Subscriber and Pub/Sub Viewer (both are required if the Pub/Sub Admin is not being used)Create subscription Pub/Sub Admin or
Pub/Sub Editor or
Pub/Sub Lite Admin or
Pub/Sub Lite EditorDelete Pub/Sub Admin or
Pub/Sub Editor or
Pub/Sub Subscriber or
Pub/Sub Lite Admin or
Pub/Sub Lite Editor
-
-
Optionally, grant access to the service account to specific users:
-
Click Done.
Obtain credentials¶
Follow these steps to obtain the credentials required for connection configuration:
-
On the Service accounts page, click the Actions menu for the service account created above, then click Manage keys.
-
Click Add Key > Create new key, select JSON as the Key type, and then click Create to download the JSON file to your computer:
-
Open the downloaded JSON file in a text editor and retain the values of the
project_id
,private_key
, andclient_email
to be used during connection configuration.