Network peering establishes a private connection between your Atlas VPC and your cloud provider's VPC. The connection isolates traffic from public networks for added security. Atlas Stream Processing supports two types of network peering connection:
Outbound: A VPC connection in which your stream processing workspace sends the peering request to your cloud provider VPC. This connection type is suitable for scenarios in which you have full administrative access to the external VPC and can approve connection requests on it.
Inbound: A VPC connection in which your cloud provider VPC sends the peering request to your stream processing workspace. This connection type is suitable for scenarios in which you don't have full administrative access to your cloud provider VPC, as it requires approval only within your Atlas VPC.
The procedures on this page walk you through creating an outbound VPC connection and creating, accepting, rejecting, and deleting an inbound VPC peering connection to your stream processing workspaces.
Prerequisites
To create and configure connections, you must have the following:
An Atlas project
An Atlas user with the
Project Owneror theProject Stream Processing Ownerrole to manage a connection registryNote
The
Project Ownerrole allows you to create database deployments, manage project access and project settings, manage IP Access List entries, and more.The
Project Stream Processing Ownerrole enables Atlas Stream Processing actions such as viewing, creating, deleting, and editing stream processing workspaces, and creating, updating, and deleting VPC Peering connections in the connection registry.See Project Roles to learn more about the differences between the two roles.
An Atlas cluster
Considerations
Atlas Stream Processing supports only RFC 1918 private IP ranges for VPC peering. You must use one of the following IP ranges:
10.0.0.0/8172.16.0.0/12192.168.0.0/16
Create Outbound VPC Peering Connections
Use the Interface selector to display the procedure for creating an outbound VPC peering connection to your stream processing workspace. Use the Kafka Deployment selector to display the procedure for generating an incoming VPC peering connection request in the following section.
Get AWS Account ID and VPC ID for a Project
If you want to create inbound VPC peering connections to your stream processing workspace, you first need to retrieve the AWS account ID, the AWS VPC ID, and the CIDR block associated with your Atlas project to initiate a VPC peering request from an external cloud environment.
To retrieve the AWS account ID, the AWS VPC ID, and the CIDR block for an Atlas project using the Atlas Administration API, see Returns the Account ID, and the VPC ID for the group and region specified
List Inbound VPC Peering Connections
To list all inbound VPC peering connections to your stream processing workspace using the Atlas Administration API, see Return All VPC Peering Connections
Accept an Inbound VPC Peering Connection
To accept an inbound VPC peering connection to your stream processing workspace using the Atlas Administration API, see Requests the acceptance of an incoming VPC Peering connection
A sample API request resembles the following:
Note
This curl command uses a service account access token (OAuth 2.0) to authenticate instead of API keys. To learn more, see Get Started with the Atlas Administration API.
curl \ -s --header "Authorization: Bearer {ACCESS-TOKEN}" \ --header 'Accept: application/vnd.atlas.2023-02-01+json' \ --header 'Content-Type: application/json' \ -d '{"requesterVpcId": "vpc-0d13eb6a2f0377854", "requesterAccountId":"417601102659"}' \ --request POST \ "https://cloud.mongodb.com/api/atlas/v2/groups/671a86f4cfc9da7d7c31b14f/streams/vpcPeeringConnections/pcx-09277e1e81d0751c1:accept"
Note the following example parameter values:
Parameter values | Description |
|---|---|
{"requesterVpcId": "vpc-0d13eb6a2f0377854", "requesterAccountId":"417601102659"} | The POST payload containing the request's VPC ID and AWS Account ID |
671a86f4cfc9da7d7c31b14f | The Atlas project Id |
pcx-09277e1e81d0751c1 | The incoming VPC connection name obtained from listing inbound VPC peering connections |
Reject an Inbound VPC Peering Connection
To reject an inbound VPC peering connection to your stream processing workspace using the Atlas Administration API, see Requests the rejection of an incoming VPC Peering connection
Delete an Inbound VPC Peering Connection
To delete an inbound VPC peering connection to your stream processing workspace using the Atlas Administration API, see Deletes an incoming VPC Peering connection