Skip to content

Commit

Permalink
feat: add static ip docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur-arch committed Aug 12, 2024
1 parent 26e4ac0 commit 4b73780
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 12 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
49 changes: 49 additions & 0 deletions content/300-accelerate/350-static-ip.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
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.

![](./images/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 in two ways:

1. When enabling Accelerate for your project environment, opt-in to static IP after specifying your database connection string and connection pool region by toggling the **Static IP** switch in the **Network restrictions** section.

2. For projects already using Accelerate, enable static IP by navigating to Accelerate settings and toggle 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 exisitng Accelerate environment to instantly access static IP support for Accelerate.

:::
14 changes: 10 additions & 4 deletions content/300-accelerate/600-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ 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.
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](./images/static-ip.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.
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.

![](./images/result-of-adding-static-ip-to-accelerate.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) for more information.
Learn more on [how to enable static IP for Accelerate in the Platform Console](/accelerate/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.
## Why do I sometimes see unexpected cache behavior?

Expand Down Expand Up @@ -146,4 +148,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.

![](./images/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 envrionment by toggling the **Static IP** switch in the **Network restrictions** section when configuring the database connection. 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
```

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.
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, use the same database URL as your current Pulse environment to instantly access static IP support for Pulse.
20 changes: 19 additions & 1 deletion content/400-pulse/600-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,22 @@ 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?

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](./../300-accelerate/images/static-ip.png)

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.

![](./images/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.
## 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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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

0 comments on commit 4b73780

Please sign in to comment.