Atlas Stream Processing supports creating Private Service Connect connections to Google Cloud Pub/Sub.
IMPORTANT: You must have an Atlas cluster hosted on Google Cloud to create a Google Cloud Private Service Connect endpoint through Atlas. Your endpoint must in the same region as this cluster.
Select an option to display the procedure to add the connection using your preferred interface:
Add a Google Cloud Pub/Sub Private Service Connect Connection through the Atlas Administration API
To add a Google Cloud Pub/Sub connection to your stream processing workspace through the Atlas Administration API, perform these steps:
Set up GCP Service Account Access.
Follow the procedure described in Set Up and Manage GCP Service Account Access.
Note the Service Account ID for use later in this procedure.
Grant the following roles at both the project and topic levels:
For more information, see the Pub/Sub documentation.
In Atlas, go to the Users page.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
Click All Projects in the sidebar under the Identity & Access section, and select your desired project.
Click Project Identity & Access in the sidebar under the Security section.
The Users page displays.
Configure a Service Account.
Create a service account.
Grant this service account the following roles within your Atlas Stream Processing project:
Create the Private Link Connection.
The Atlas Administration API provides an endpoint to Create One Private Link.
For a Google Cloud Pub/Sub Private Service Connect connection, set the following key-value pairs:
Key | Value |
|---|---|
|
|
|
|
| The Google Cloud region in which you create the endpoint. |
Use Return All Private Link Connections to check the state of your endpoint. When it reaches a DONE state, note the value of the _id field.
Create the GCP Pub/Sub Private Service Connect Connection.
The Atlas Administration API provides an endpoint to Create One Stream Connection.
For a Google Cloud Pub/Sub Private Service Connect connection, set the following key-value pairs:
Key | Value |
|---|---|
| Name you want to give to the connection. |
| "GCPPubSub" |
|
|
| "PRIVATE_LINK" |
| Value of |
Add a Google Cloud Pub/Sub Private Service Connect Connection through the Atlas CLI
To add a Google Cloud Pub/Sub connection to your stream processing workspace through the Atlas CLI, perform these steps:
Set up GCP Service Account Access.
Follow the procedure described in Set Up and Manage GCP Service Account Access.
Note the Service Account ID for use later in this procedure.
Grant the following roles at both the project and topic levels:
For more information, see the Pub/Sub documentation.
In Atlas, go to the Users page.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
Click All Projects in the sidebar under the Identity & Access section, and select your desired project.
Click Project Identity & Access in the sidebar under the Security section.
The Users page displays.
Configure a Service Account.
Create a service account.
Grant this service account the following roles within your Atlas Stream Processing project:
Create the Private Link Connection.
To a Private Link endpoint for a stream processor connection using the Atlas CLI, run the following command:
atlas streams privateLinks create [options]
To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas streams privateLinks create.
In your configuration file, set the following key-value pairs:
Key | Value |
|---|---|
|
|
|
|
| Google Cloud region in which you create the endpoint. |
Use atlas streams privateLinks list command to check the state of your endpoint. When it reaches a DONE state, note the value of the _id field.
Create the Google Cloud Pub/Sub connection.
To create one connection for the stream processing workspace you specify using the Atlas CLI, run the following command:
atlas streams connections create [connectionName] [options]
To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas streams connections create.
In your configuration file, set the following key-value pairs:
Key | Value |
|---|---|
| Name for the connection. |
| "GCPPubSub" |
|
|
| "PRIVATE_LINK" |
| Value of |
Add a Google Cloud Pub/Sub Private Service Connect Connection through the Atlas UI
To add a Google Cloud Pub/Sub connection to your stream processing workspace through the Atlas UI, follow these steps:
Set up GCP Service Account Access.
Follow the procedure described in Set Up and Manage GCP Service Account Access.
Note the Service Account ID for use later in this procedure.
Grant the following roles at both the project and topic levels:
For more information, see the Pub/Sub documentation.
In Atlas, go to the Database & Network Access page for your project.
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Database & Network Access under the Security heading.
The Database & Network Access page displays.
In Atlas, go to the Stream Processing page for your project.
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Stream Processing under the Streaming Data heading.
The Stream Processing page displays.
Add a new connection.
Click + Add connection.
Select a GCP Pub/Sub connection.
Provide a Connection Name. Each connection name must be unique within a stream processing workspace. This is the name used to reference the connection in Atlas Stream Processing aggregations.
Click the Private Service Connect button.
Toggle Enable Private Service Connect Networking on.
From the dropdown menu, select the private endpoint you created earlier.
From the GCP Service Account dropdown, select the ID of the unified access role you authorized in a prior step.
Click Add connection.
Supported Aggregation Behavior
Google Cloud Pub/Sub sink connections support only the $emit stage, not the $merge stage. For more information, see $emit.