Skip to content

Commit f12788b

Browse files
thomasgauvinOxyjun
authored andcommitted
Hyperdrive private database support improved UI docs (#19400)
* thomasgauvin: add changelog, changelog-next, updated docs for improved ui hoa experience * thomasgauvin: fix date * Update src/content/changelogs-next/2025-01-28-hyperdrive-automated-private-database-configuration.mdx * Update src/content/changelogs-next/2025-01-28-hyperdrive-automated-private-database-configuration.mdx * Update src/content/docs/hyperdrive/configuration/connect-to-private-database.mdx * Update src/content/docs/hyperdrive/configuration/connect-to-private-database.mdx --------- Co-authored-by: Jun Lee <[email protected]>
1 parent 5f8028d commit f12788b

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed
145 KB
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Automatic configuration for private databases on Hyperdrive
3+
description: Hyperdrive now automatically configures your Cloudflare Tunnel to connect to your private database.
4+
products:
5+
- hyperdrive
6+
date: 2025-01-28T18:00:00Z
7+
---
8+
9+
Hyperdrive now automatically configures your Cloudflare Tunnel to connect to your private database.
10+
11+
![Automatic configuration of Cloudflare Access and Service Token in the Cloudflare dashboard for Hyperdrive.](~/assets/images/hyperdrive/configuration/hyperdrive-private-database-automatic-configuration.png)
12+
13+
When creating a Hyperdrive configuration for a private database, you only need to provide your database credentials and set up a Cloudflare Tunnel within the private network where your database is accessible. Hyperdrive will automatically create the Cloudflare Access, Service Token, and Policies needed to secure and restrict your Cloudflare Tunnel to the Hyperdrive configuration.
14+
15+
To create a Hyperdrive for a private database, you can follow the [Hyperdrive documentation](/hyperdrive/configuration/connect-to-private-database/). You can still manually create the Cloudflare Access, Service Token, and Policies if you prefer.
16+
17+
This feature is available from the Cloudflare dashboard.

src/content/changelogs/hyperdrive.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ productLink: "/hyperdrive/"
55
productArea: Developer platform
66
productAreaLink: /workers/platform/changelog/platform/
77
entries:
8+
- publish_date: "2025-01-28"
9+
title: Hyperdrive automatically configures your Cloudflare Tunnel to connect to your private database.
10+
description: |-
11+
When creating a Hyperdrive configuration for a private database, you only need to provide your database credentials and set up a Cloudflare Tunnel within the private network where your database is accessible.
12+
13+
Hyperdrive will automatically create the Cloudflare Access, Service Token and Policies needed to secure and restrict your Cloudflare Tunnel to the Hyperdrive configuration.
14+
15+
Refer to [documentation on how to configure Hyperdrive to connect to a private database](/hyperdrive/configuration/connect-to-private-database/).
816
- publish_date: "2024-12-11"
917
title: Hyperdrive now caches queries in all Cloudflare locations decreasing cache hit latency by up to 90%
1018
description: |-

src/content/docs/hyperdrive/configuration/connect-to-private-database.mdx

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,29 @@ Your tunnel must be configured to use a public hostname so that Hyperdrive can r
5858
If you are setting up the tunnel through the CLI instead ([locally-managed tunnel](/cloudflare-one/connections/connect-networks/configure-tunnels/local-management/)), you will have to complete these steps manually. Follow the Cloudflare Zero Trust documentation to [add a public hostname to your tunnel](/cloudflare-one/connections/connect-networks/routing-to-tunnel/dns/) and [configure the public hostname to route to the address of your database](/cloudflare-one/connections/connect-networks/configure-tunnels/local-management/configuration-file/).
5959
:::
6060

61-
## 2. Create a service token
61+
## 2. Create and configure Hyperdrive to connect to the Cloudflare Tunnel
62+
63+
To restrict access to the Cloudflare Tunnel to Hyperdrive, a [Cloudflare Access application](/cloudflare-one/applications/) must be configured with a [Policy](/cloudflare-one/policies/) that requires requests to contain a valid [Service Auth token](/cloudflare-one/policies/access/#service-auth).
64+
65+
The Cloudflare dashboard can automatically create and configure the underlying [Cloudflare Access application](/cloudflare-one/applications/), [Service Auth token](/cloudflare-one/policies/access/#service-auth), and [Policy](/cloudflare-one/policies/) on your behalf. Alternatively, you can manually create the Access application and configure the Policies.
66+
67+
<Tabs> <TabItem label="Automatic creation">
68+
69+
### 2.1 Create a Hyperdrive configuration in the Cloudflare dashboard
70+
71+
Create a Hyperdrive configuration in the Cloudflare dashboard to automatically configure Hyperdrive to connect to your Cloudflare Tunnel.
72+
73+
1. In the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/hyperdrive), navigate to **Storage & Databases > Hyperdrive** and click **Create configuration**.
74+
2. Select **Private database**.
75+
3. In the **Networking details** section, select the tunnel you are connecting to.
76+
4. In the **Networking details** section, select the hostname associated to the tunnel. If there is no hostname for your database, return to step [1.2. Connect your database using a public hostname](/hyperdrive/configuration/connect-to-private-database/#12-connect-your-database-using-a-public-hostname).
77+
5. In the **Access Service Authentication Token** section, select **Create new (automatic)**.
78+
6. In the **Access Application** section, select **Create new (automatic)**.
79+
7. In the **Database connection details** section, enter the database **name**, **user**, and **password**.
80+
81+
</TabItem>
82+
<TabItem label="Manual creation">
83+
### 2.1 Create a service token
6284

6385
The service token will be used to restrict requests to the tunnel, and is needed for the next step.
6486

@@ -78,7 +100,7 @@ The service token will be used to restrict requests to the tunnel, and is needed
78100
This is the only time Cloudflare Access will display the Client Secret. If you lose the Client Secret, you must regenerate the service token.
79101
:::
80102

81-
## 3. Create an Access application to secure the tunnel
103+
### 2.2 Create an Access application to secure the tunnel
82104

83105
[Cloudflare Access](/cloudflare-one/policies/access/) will be used to verify that requests to the tunnel originate from Hyperdrive using the service token created above.
84106

@@ -116,7 +138,7 @@ The service token will be used to restrict requests to the tunnel, and is needed
116138

117139
17. Save the application.
118140

119-
## 4. Create a Hyperdrive configuration
141+
### 2.3 Create a Hyperdrive configuration
120142

121143
To create a Hyperdrive configuration for your private database, you'll need to specify the Access application and Cloudflare Tunnel information upon creation.
122144

@@ -158,7 +180,9 @@ In addition, it will also set the Access Client ID and the Access Client Secret
158180
When creating the Hyperdrive configuration for the private database, you must enter the `access-client-id` and the `access-client-id`, and omit the `port`. Hyperdrive will route database messages to the public hostname of the tunnel, and the tunnel will rely on its service configuration (as configured in [1.2. Connect your database using a public hostname](#12-connect-your-database-using-a-public-hostname)) to route requests to the database within your private network.
159181
:::
160182

161-
## 5. Query your Hyperdrive configuration from a Worker (optional)
183+
</TabItem> </Tabs>
184+
185+
## 3. Query your Hyperdrive configuration from a Worker (optional)
162186

163187
To test your Hyperdrive configuration to the database using Cloudflare Tunnel and Access, use the Hyperdrive configuration ID in your Worker and deploy it.
164188

0 commit comments

Comments
 (0)