|
| 1 | +--- |
| 2 | +meta: |
| 3 | + title: How to connect a Managed MongoDB® Database Instance to a Private Network |
| 4 | + description: Instructions for connecting your MongoDB® Database Instance over a Private Network. |
| 5 | +content: |
| 6 | + h1: How to connect a Managed MongoDB® Database Instance to a Private Network |
| 7 | + paragraph: Instructions for connecting your MongoDB® Database Instance over a Private Network. |
| 8 | +tags: managed-mongodb mongodb private-network database-instance |
| 9 | +dates: |
| 10 | + validation: 2025-02-17 |
| 11 | + posted: 2025-02-17 |
| 12 | +categories: |
| 13 | + - managed-databases |
| 14 | + - mongodb |
| 15 | +--- |
| 16 | + |
| 17 | +[Private Networks](/vpc/concepts/#private-networks) allows you to enhance the security of your system's architecture by isolating it from the internet. |
| 18 | + |
| 19 | +Using Private Networks improves performance by reducing the latency between your application and your database nodes. It also increases the security of your databases, as Instances in your Private Network can directly communicate with your Database Instance, without passing through the public internet. |
| 20 | + |
| 21 | +You can create new Database Instances to attach to your Private Network, or attach existing ones. |
| 22 | + |
| 23 | +<Macro id="requirements" /> |
| 24 | + |
| 25 | +- A Scaleway account logged into the [console](https://console.scaleway.com) |
| 26 | +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization |
| 27 | +- A valid [API key](/iam/how-to/create-api-keys/) |
| 28 | +- A [Managed MongoDB® Database Instance](/managed-mongodb-databases/how-to/create-a-database-instance) |
| 29 | + |
| 30 | +## How to attach a Database Instance to a Private Network |
| 31 | + |
| 32 | + <Message type="note"> |
| 33 | + You can only attach your Database Instance to one Private Network at a time. |
| 34 | + </Message> |
| 35 | + |
| 36 | +1. Click **MongoDB®** under **Managed Databases** on the side menu. A list of your Database Instances displays. |
| 37 | +2. Click the database name or <Icon name="more" /> > **More info** to access the Database Instance information page. |
| 38 | +3. Scroll to the **Network** section. |
| 39 | +4. Click **Attach Private Network** next to **Private endpoint**. A pop-up appears. |
| 40 | +5. Choose whether to: |
| 41 | + - Select and attach an existing Private Network and select the network from the drop-down list. |
| 42 | + <Message type="important"> |
| 43 | + The Database Instance must be attached to a Private Network in the same region. |
| 44 | + </Message> |
| 45 | + - Create and attach a new Private Network and enter the name of the network in the form. |
| 46 | + <Message type="important"> |
| 47 | + If you select this option, a Private Network with default settings will be created in the same region as your Database Instance. Do not use a TLD (e.g. dev, cloud) as a name, to avoid conflicts. |
| 48 | + </Message> |
| 49 | +6. Click **Attach to Private Network** to conclude. |
| 50 | + |
| 51 | +<Message type="important"> |
| 52 | +Managed MongoDB® is currently not compatible with the [Static NAT](/public-gateways/concepts/#nat) feature of [Scaleway Public Gateways](/public-gateways/concepts/#public-gateway). You can use Public Gateways in [SSH bastion](/public-gateways/how-to/use-ssh-bastion/) mode and perform port forwarding. |
| 53 | +</Message> |
| 54 | + |
| 55 | +<Message type="tip"> |
| 56 | +Once you have attached your Database Instance to a Private Network, you can [connect to the Database Instance](/managed-mongodb-databases/how-to/connect-database-instance) using the private endpoint connection string. |
| 57 | +</Message> |
| 58 | + |
| 59 | +## How to detach a Database Instance from a Private Network |
| 60 | + |
| 61 | +1. Click **MongoDB®** under **Managed Databases** on the side menu. A list of your Database Instances displays. |
| 62 | +2. Click the database name or <Icon name="more" /> > **More info** to access the Database Instance information page. |
| 63 | +3. Scroll to the **Network** section. |
| 64 | +4. Click <Icon name="unlink" /> next to the static IP that you want to unlink from your Database Instance. |
| 65 | +5. Click **Detach Private Network** to remove the Instance from your Private Network. |
| 66 | + |
| 67 | +<Message type="note"> |
| 68 | +This action takes a few moments to complete. During this time, your Database Instance: |
| 69 | + - remains available, |
| 70 | + - goes into **Configuring** mode, and |
| 71 | + - network configuration actions become unavailable |
| 72 | +</Message> |
0 commit comments