Skip to content

Commit

Permalink
feat: add static ip docs (#6191)
Browse files Browse the repository at this point in the history
* feat: add static ip docs

* Optimised images with calibre/image-actions

* fix: correct spellings

* Update content/400-pulse/500-known-limitations.mdx

Co-authored-by: Jon Harrell <[email protected]>

* feat: move images and rearrange section

* feat: improve step clarity

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jon Harrell <[email protected]>
Co-authored-by: Marc Hess <[email protected]>
  • Loading branch information
4 people authored Aug 15, 2024
1 parent 8df8f44 commit 75cbf45
Show file tree
Hide file tree
Showing 14 changed files with 157 additions and 14 deletions.
6 changes: 3 additions & 3 deletions content/300-accelerate/200-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ To get started with Accelerate, you will need the following:

Navigate to your Prisma Data Platform project, choose an environment, and enable Accelerate by providing your database connection string and selecting the region nearest your database.

<Admonition>
:::note

If you require IP allowlisting or firewall configurations with trusted IP addresses, enable Static IP for enhanced security
If you require IP allowlisting or firewall configurations with trusted IP addresses, enable Static IP for enhanced security. Learn more on [how to enable static IP for Accelerate in the Platform Console](/accelerate/static-ip).

</Admonition>
:::

## 2. Add Accelerate to your application

Expand Down
56 changes: 56 additions & 0 deletions content/300-accelerate/350-static-ip.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "Static IP"
metaTitle: "Enable Static IP for Prisma Accelerate"
metaDescription: "Learn enabling Static IP for Prisma Accelerate."
---

You can enable static IP for Accelerate when your security setup requires IP allowlisting or if you're implementing firewalls that only permit access from trusted IPs, ensuring controlled and secure database connections.

![Result of enabling static IP Accelerate with a database using IP allowlisting](/img/accelerate/result-of-adding-static-ip-to-accelerate.png)

:::info

To enable static IP support for Accelerate within an existing or a new project environment, your workspace will need to be on our Pro or Business plans. Take a look at the [pricing page](https://www.prisma.io/pricing#accelerate) for more information.

:::

## Enable static IP in Accelerate

You can opt-in to use static IP for Accelerate in the [Platform Console](https://pris.ly/pdp) in two ways:

### 1. When enabling Accelerate for your project environment:

1. Specify your database connection string and connection pool region.
2. Enable static IP by toggling the **Static IP** switch in the **Network restrictions** section.
3. Click on the **Enable Accelerate** button.

### 2. For projects already using Accelerate:

1. Navigate to the Accelerate **Settings** tab in the project environment.
2. Enable static IP by toggling the **Static IP** switch in the **Network restrictions** section.

Enabling static IP for Accelerate will provide you with a list of static IPv4 and IPv6 addresses.

Example IPv4 address range:
```
52.86.207.46/32
100.29.164.162/32
54.211.230.107/32
18.235.169.169/32
54.209.237.70/32
44.221.111.173/32
```

Example IPv6 address range:
```
2600:1f18:51ce:b00::/64
2600:1f18:5acb:9a00::/56
```

Once you have these addresses, configure your database firewall to allow incoming connections only from these IPs and any other trusted IPs that need access to your database.

:::note

Since you cannot enable static IP for an existing Accelerate-enabled environment, we recommend opting for static IP when enabling Accelerate in a new environment. Use the same database URL as your existing Accelerate environment to instantly access static IP support for Accelerate.

:::
23 changes: 17 additions & 6 deletions content/300-accelerate/600-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ toc: true

## When should I enable static IP for Prisma Accelerate?

A static IP address is an IPv4 or an IPv6 address that is fixed. Unlike dynamic IP addresses, which can change unpredictably, traffic from static IP addresses can be easily identified. Enable static IP for Accelerate when your security setup requires IP allowlisting or if you're implementing firewalls that only permit access from trusted IPs, ensuring controlled and secure database connections.
Enable static IP for Accelerate when your security setup requires IP allowlisting or if you're implementing firewalls that only permit access from trusted IPs, ensuring controlled and secure database connections.

![What is a static IP](./images/static-ip.png)
![Result of enabling static IP Accelerate with a database using IP allowlisting](/img/accelerate/result-of-adding-static-ip-to-accelerate.png)

For databases using IP allowlisting, enable static IP for Accelerate in your specified project environment, and add the obtained IP address to your database's allowlist to ensure authorized access from Accelerate.
Learn more on [how to enable static IP for Accelerate in the Platform Console](/accelerate/static-ip).

![](./images/result-of-adding-static-ip-to-accelerate.png)
:::info
**What is a static IP?**

> ℹ️ To enable static IP support for Accelerate within your existing or new project environment, your workspace will need to be on our **Pro** or **Business** plans. Take a look at the [pricing page](https://www.prisma.io/pricing) for more information.
A static IP address is an IPv4 or an IPv6 address that is fixed. Unlike dynamic IP addresses, which can change unpredictably, traffic from static IP addresses can be easily identified.

![What is a static IP](/img/accelerate/static-ip.png)
:::


> ℹ️ To enable static IP support for Accelerate within your existing or new project environment, your workspace will need to be on our **Pro** or **Business** plans. Take a look at the [pricing page](https://www.prisma.io/pricing#accelerate) for more information.
## Why do I sometimes see unexpected cache behavior?

Expand Down Expand Up @@ -146,4 +153,8 @@ await prisma.$transaction([
]);
```

If you don't need [interactive transactions](/orm/prisma-client/queries/transactions#interactive-transactions), you can save costs and improve performance by using [sequential operations transactions](/orm/prisma-client/queries/transactions#sequential-prisma-client-operations). Sequential operations transactions perform better on Accelerate because they execute in one round-trip to the database, while interactive transactions require separate round-trips for start, commit, and each individual operation on the transaction.
If you don't need [interactive transactions](/orm/prisma-client/queries/transactions#interactive-transactions), you can save costs and improve performance by using [sequential operations transactions](/orm/prisma-client/queries/transactions#sequential-prisma-client-operations). Sequential operations transactions perform better on Accelerate because they execute in one round-trip to the database, while interactive transactions require separate round-trips for start, commit, and each individual operation on the transaction.

## Do the static IP ranges for Accelerate and Pulse differ?

No, if you have static IP enabled for both Accelerate and Pulse using the same database URL, the generated static IP ranges will be the same for both products.
4 changes: 2 additions & 2 deletions content/300-accelerate/650-troubleshoot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ This error indicates that Prisma Accelerate cannot establish a connection to you

#### Database Not Publicly accessible

Prisma Accelerate currently requires the database to be publicly accessible. If your database is behind a VPC, or access is restricted to specific IP addresses, this error may occur.
If your database is within a VPC or access is limited to specific IP addresses, you might encounter this error if static IP is not enabled for Accelerate or if the static IPs are not permitted in your database firewall.

**Suggested solution:** Ensure your database is publicly accessible, if not, allow public access. Please note this is only an interim requirement, Static IPs are coming soon and will alleviate the need for complete public access if that’s not desirable.
**Suggested solution:** [Enable static IP for Accelerate](/accelerate/static-ip) and configure your database firewall to allow access from the provided static IP addresses.

#### Unreachable Database Host/Port

Expand Down
1 change: 1 addition & 0 deletions content/400-pulse/200-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The Pulse **Setup** screen requires you to:

1. provide your **Database connection string**
1. select a **Region** where Pulse should be hosted
1. Enable **Static IP** if your database is using IP allowlisting. Learn more about enabling static IP for Pulse [here](/pulse/static-ip).
1. decide whether you want to use the **Automatic setup** for [**Database replication**](/pulse/database-setup/general-database-instructions#enable-logical-replication) (only available on paid plans)
1. make sure **Event persistence** is enabled to use delivery guarantees with [`.stream()`](/pulse/api-reference#stream) (or disable it if you want to use [`.subscribe()`](/pulse/api-reference#subscribe) for fully ephemeral events without delivery guarantees)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ toc: true

<Admonition>

Prisma Pulse requires a publicly accessible PostgreSQL (**version 12+**) database with logical replication enabled. To configure specific database providers for Prisma Pulse, visit [here](/pulse/database-setup#provider-specific-instructions).
Prisma Pulse requires a PostgreSQL (**version 12+**) database with logical replication enabled. To configure specific database providers for Prisma Pulse, visit [here](/pulse/database-setup#provider-specific-instructions).

</Admonition>

Expand Down
2 changes: 1 addition & 1 deletion content/400-pulse/250-database-setup/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Prisma Pulse requires your database to be configured in a specific way. To get y

<Admonition>

Prisma Pulse requires a publicly accessible PostgreSQL (**version 12+**) database with [logical replication](/pulse/database-setup/general-database-instructions#enable-logical-replication) enabled.
Prisma Pulse requires a PostgreSQL (**version 12+**) database with [logical replication](/pulse/database-setup/general-database-instructions#enable-logical-replication) enabled.

</Admonition>

Expand Down
38 changes: 38 additions & 0 deletions content/400-pulse/275-static-ip.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Static IP"
metaTitle: "Enable Static IP for Prisma Pulse"
metaDescription: "Learn enabling Static IP for Prisma Pulse."
---

You can enable static IP for Pulse when your security setup requires IP allowlisting or if you're implementing firewalls that only permit access from trusted IPs, ensuring controlled and secure database connections.

![Result of enabling static IP Pulse with a database using IP allowlisting](/img/pulse/result-of-adding-static-ip-to-pulse.png)

:::info

To enable static IP support for Pulse within a new project environment, your workspace will need to be on our Pro or Business plans. Take a look at the [pricing page](https://www.prisma.io/pricing#pulse) for more information.

:::

## Enable static IP for Pulse

You can opt-in to use static IP for Pulse when enabling it for a project environment:

1. Insert the database connection string and the closest region to the database.
2. Toggle the **Static IP** switch in the **Network restrictions** section. This will provide you with a list of static IPv4 and IPv6 addresses.
Example IPv4 address range:
```
52.86.207.46/32
100.29.164.162/32
54.211.230.107/32
18.235.169.169/32
54.209.237.70/32
44.221.111.173/32
```
Example IPv6 address range:
```
2600:1f18:51ce:b00::/64
2600:1f18:5acb:9a00::/56
```
3. Once you have these addresses, configure your database firewall to allow incoming connections only from these IPs and any other trusted IPs that need access to your database.
4. Click on the **Enable Pulse** button.
3 changes: 3 additions & 0 deletions content/400-pulse/500-known-limitations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ Note that database events are base64 encoded for transmission. The size limit ap

If your events exceed the size limit, they will be rejected by Prisma Pulse and won't arrive on the receiver side. You can see how many events have been rejected by Prisma Pulse in the Pulse Dashboard in the [Console](https://console.prisma.io/login).

## Static IP cannot be enabled for existing Pulse-enabled environments

Currently, static IP cannot be enabled for an existing Pulse-enabled environment. To use static IP, you must opt-in to use static IP when enabling Pulse in a new environment. As a workaround, create a new environment in your project with the same database connection string as your current Pulse-enabled environment in order to gain static IP support for Pulse.
24 changes: 23 additions & 1 deletion content/400-pulse/600-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,26 @@ If you encounter issues with SSL/TLS encryption while using Pulse, ensure your d
postgres://username:password@hostname:port/database?sslmode=require
```

This [setting](/orm/overview/databases/postgresql#configuring-an-ssl-connection) will enforce SSL/TLS encryption and accept self-signed certificates.
This [setting](/orm/overview/databases/postgresql#configuring-an-ssl-connection) will enforce SSL/TLS encryption and accept self-signed certificates.

## When should I enable static IP for Prisma Pulse?

Enable static IP for Pulse when your security setup requires IP allowlisting or if you're implementing firewalls that only permit access from trusted IPs, ensuring controlled and secure database connections.

![Result of enabling static IP Pulse with a database using IP allowlisting](/img/pulse/result-of-adding-static-ip-to-pulse.png)

Learn more on [how to enable static IP for Pulse in the Platform Console](/pulse/static-ip).

> ℹ️ To enable static IP support for Accelerate within your existing or new project environment, your workspace will need to be on our **Pro** or **Business** plans. Take a look at the [pricing page](https://www.prisma.io/pricing#accelerate) for more information.
:::info
**What is a static IP?**

A static IP address is an IPv4 or an IPv6 address that is fixed. Unlike dynamic IP addresses, which can change unpredictably, traffic from static IP addresses can be easily identified.

![What is a static IP](/img/accelerate/static-ip.png)
:::

## Do the static IP ranges for Accelerate and Pulse differ?

No, if you have static IP enabled for both Accelerate and Pulse using the same database URL, the generated static IP ranges will be the same for both products.
12 changes: 12 additions & 0 deletions content/500-platform/10-about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,21 @@ In each environment, you can:
- set your database connection string (of a [Pulse-compatible database](/pulse/database-setup)).
- configure the _region_ where Pulse is running.
- configure database replication.
- enable static IP.

The number of environments you can create in a project depends on the [subscription plan](https://www.prisma.io/pricing?utm_source=docs&utm_medium=platform-docs) configured in your workspace.

## Database connection management

The **Database** tab in the left panel of a project environment lets you configure and manage connections to your remote database. Within this tab, the **Connections** section displays a table with the following columns:

| Column Name | Description |
|-------------|-------------|
| **Hint** | Provides the URL structure for the database in use. |
| **Static IP** | Indicates whether static IP is enabled for the database and associated products. |
| **Products** | Lists the products that are enabled using the database URL. |
| **Action** | Allows you to disable all active products and remove the connection. |

## Billing

The [subscription plan](https://www.prisma.io/pricing?utm_source=docs&utm_medium=platform-docs) you select in your workspace determines how many projects and environments you can create in that workspace:
Expand Down
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 75cbf45

Please sign in to comment.