> This page location: /docs.md > /docs/development.md > /docs/atlas/atlas-stream-processing.md > /docs/atlas/atlas-stream-processing/manage-connection-registry.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Add an AWS Lambda Private Link Connection

Atlas Stream Processing supports creating Private Link connections to AWS (Amazon Web Services) Lambda using the [$externalFunction](https://www.mongodb.com/docs/atlas/atlas-stream-processing/sp-agg-externalfunction.md#std-label-atlas-sp-agg-external-function) stage. Select an option to display the procedure to add the connection using your preferred interface:

## Add an AWS Lambda Private Link Connection through the Atlas Administration API

To add an AWS (Amazon Web Services) Lambda Private Link connection to your stream processing workspace through the Atlas Administration API, follow these steps:

1. Create AWS (Amazon Web Services) resources.

   Follow the procedure described in the [$externalFunction](https://www.mongodb.com/docs/atlas/atlas-stream-processing/sp-agg-externalfunction.md#std-label-atlas-sp-agg-externalFunction-auth) documentation.

2. Configure a Service Account.

   Create a [service account.](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-atlas-admin-api-access)

   [Grant](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-grant-api-access-project) this service account the following roles within your Atlas Stream Processing project:

   - [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner)

   - [`Project Stream Processing Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Stream-Processing-Owner)

   - [`Project Stream Processing Manager`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Stream-Processing-Manager)

3. Create the Private Link Connection.

   The Atlas Administration API provides an endpoint to [Create One Private Link](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-creategroupstreamprivatelinkconnection)

   For an `$externalFunction` Private Link connection, set the following key-value pairs:

   | Key | Value |
   | --- | --- |
   | `vendor` | `"LAMBDA"` |
   | `provider` | `"AWS"` |
   | `region` | The AWS (Amazon Web Services) region in which you create the endpoint. |
   | `serviceEndpointId` | `"com.amazonaws.<region>.s3"` where `<region>` is the name of the AWS (Amazon Web Services) region in which you create the endpoint. |

   Use [Return All Private Link Connections](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupstreamprivatelinkconnections) to check the `state` of your endpoint. When it reaches a `DONE` state, note the value of the `_id` field and proceed to the next step.

4. Create the AWS (Amazon Web Services) Lambda connection.

   The Atlas Administration API provides an endpoint to [Create One Connection.](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-creategroupstreamconnection)

   For an AWS (Amazon Web Services) Lambda Private Link connection, set the following key-value pairs:

   | Key | Value |
   | --- | --- |
   | `name` | The name you want to give to the connection. |
   | `type` | `"AWS Lambda"` |
   | `aws.roleArn` | Value of the ARN noted in an earlier step. |
   | `publicPrivateNetworking.access.type` | "PRIVATE_LINK" |
   | `publicPrivateNetworking.access.connectionId` | The `_id` value in the response when you create the Private Link connection. |

## Add an AWS Lambda Private Link Connection through the Atlas CLI

To add an AWS (Amazon Web Services) Lambda Private Link connection to your stream processing workspace through the Atlas CLI, follow these steps:

1. Create AWS (Amazon Web Services) resources.

   Follow the procedure described in the [$externalFunction](https://www.mongodb.com/docs/atlas/atlas-stream-processing/sp-agg-externalfunction.md#std-label-atlas-sp-agg-externalFunction-auth) documentation.

2. Configure a Service Account.

   Create a [service account.](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-atlas-admin-api-access)

   [Grant](https://www.mongodb.com/docs/atlas/configure-api-access.md#std-label-grant-api-access-project) this service account the following roles within your Atlas Stream Processing project:

   - [`Project Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner)

   - [`Project Stream Processing Owner`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Stream-Processing-Owner)

   - [`Project Stream Processing Manager`](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Stream-Processing-Manager)

3. Create the Private Link Connection.

   To a Private Link endpoint for a stream processor connection using the Atlas CLI, run the following command:

   ```sh

   atlas streams privateLinks create [options]

   ```

   To learn more about the command syntax and parameters, see the Atlas CLI documentation for [atlas streams privateLinks create.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-streams-privateLinks-create/)

   In your configuration file, set the following key-value pairs:

   | Key | Value |
   | --- | --- |
   | `vendor` | `"LAMBDA"` |
   | `provider` | `"AWS"` |
   | `region` | The AWS (Amazon Web Services) region in which you create the endpoint. |
   | `serviceEndpointId` | `"com.amazonaws.<region>.s3"` where `<region>` is the name of the AWS (Amazon Web Services) region in which you create the endpoint. |

   Use [atlas streams privateLinks list](https://www.mongodb.com/docs/atlas/cli/currentatlas-streams-privateLinks-list/) command to check the `state` of your endpoint. When it reaches a `DONE` state, note the value of the `_id` field and proceed to the next step.

4. Create the AWS (Amazon Web Services) Lambda connection.

   To create one connection for the stream processing workspace you specify using the Atlas CLI, run the following command:

   ```sh

   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.](https://www.mongodb.com/docs/atlas/cli/current/command/atlas-streams-connections-create/)

   In your configuration file, set the following key-value pairs:

   | Key | Value |
   | --- | --- |
   | `name` | The name you want to give to the connection. |
   | `type` | `"AWSLambda"` |
   | `aws.roleArn` | Value of the ARN noted in an earlier step. |
   | `publicPrivateNetworking.access.type` | "PRIVATE_LINK" |
   | `publicPrivateNetworking.access.connectionId` | The `_id` value in the response when you create the Private Link connection. |

## Add an AWS Lambda Private Link Connection through the Atlas UI

To add an AWS (Amazon Web Services) Lambda Private Link connection to your stream processing workspace through the Atlas UI, follow these steps:

1. 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](https://cloud.mongodb.com/go?l=https%3A%2F%2Fcloud.mongodb.com%2Fv2%2F%3Cproject%3E%23%2Fsecurity%2Fnetwork%2FaccessList) page displays.

2. Navigate to the Atlas Stream Processing private endpoint interface.

   In the sidebar, click Private Endpoint.

   Click the Atlas Stream Processing tab.

   If you have not created an Atlas Stream Processing private endpoint previously, click Create endpoint. If you have, click Add ASP Endpoint.

3. Select your cloud provider and vendor.

   Set Cloud Provider to AWS.

   Set Vendor to Lambda.

   Click Next, enter service details

4. Provide your AWS (Amazon Web Services) Lambda endpoint region.

   Your endpoint must be in the same region in which you intend to host the stream processors that use it.

5. Set up Unified AWS Access.

   Follow the procedure described in [Set Up Unified AWS Access.](https://docs.mongodb.com/atlas/security/set-up-unified-aws-access/?interface=atlas-ui)

   Note the ARN value in `Statement.Principal.AWS` to use later in this procedure.

6. 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](https://cloud.mongodb.com/go?l=https%3A%2F%2Fcloud.mongodb.com%2Fv2%2F%3Cproject%3E%23%2Faccess) page displays.

7. 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](https://cloud.mongodb.com/go?l=https%3A%2F%2Fcloud.mongodb.com%2Fv2%2F%3Cproject%3E%23%2FstreamProcessing) page displays.

8. Go to the Connection Registry.

   Locate the overview panel of the stream processing workspace you want to modify and click Configure.

   Select the Connection Registry tab.

9. Click + Add connection.

10. Add a new connection.

    Select an AWS Lambda 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.](https://www.mongodb.com/docs/atlas/atlas-stream-processing/stream-aggregation-stages.md#std-label-atlas-sp-aggregation)

    Click the PrivateLink button. Then, toggle Enable PrivateLink networking.

    From the dropdown menu, select the private endpoint you created earlier.

    From the AWS IAM Role ARN dropdown, select the ARN of the unified access role you authorized in a prior step.

    Click Add connection.
