Skip to content

Commit d39a3f7

Browse files
committed
PCX Review
1 parent 5ef9679 commit d39a3f7

File tree

11 files changed

+57
-113
lines changed

11 files changed

+57
-113
lines changed

src/content/changelog/workers-vpc/2025-09-25-workers-vpc.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ We're excited to announce the beta release of **Workers VPC Services**, enabling
1414

1515
## Getting started
1616

17-
Set up a Cloudflare Tunnel, create a VPC Service, add service bindings to your Worker, and access private resources securely. [Read the documentation](/workers-vpc/) to get started.
17+
Set up a Cloudflare Tunnel, create a VPC Service, add service bindings to your Worker, and access private resources securely. [Refer to the documentation](/workers-vpc/) to get started.

src/content/docs/workers-vpc/api/index.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Each request made on the binding will route to the specific service that was con
1313

1414
:::note
1515

16-
Workers VPC is currently in beta. Features and APIs may change before general availability. During the beta, Workers VPC is available for free to all Workers plans.
16+
Workers VPC is currently in beta. Features and APIs may change before general availability. While in beta, Workers VPC is available for free to all Workers plans.
1717

1818
:::
1919

@@ -25,7 +25,7 @@ A VPC Service binding is accessed via the `env` parameter in your Worker's fetch
2525

2626
Makes an HTTP request to the private service through the configured tunnel.
2727

28-
```javascript
28+
```js
2929
const response = await env.VPC_SERVICE_BINDING.fetch(url, options);
3030
```
3131

@@ -50,7 +50,7 @@ Returns a `Promise<Response>` that resolves to a standard Fetch API Response obj
5050

5151
#### Basic GET request
5252

53-
```javascript
53+
```js
5454
export default {
5555
async fetch(request, env) {
5656
const privateRequest = new Request(
@@ -68,7 +68,7 @@ export default {
6868

6969
#### POST request with body
7070

71-
```javascript
71+
```js
7272
export default {
7373
async fetch(request, env) {
7474
const privateRequest = new Request(
@@ -102,7 +102,7 @@ export default {
102102

103103
#### Request with HTTPS and IP address
104104

105-
```javascript
105+
```js
106106
export default {
107107
async fetch(request, env) {
108108
const privateRequest = new Request("https://10.0.1.50:8443/api/data");
@@ -116,4 +116,4 @@ export default {
116116
## Next steps
117117

118118
- Configure [service bindings in wrangler.toml](/workers-vpc/configuration/vpc-services/)
119-
- View [usage examples](/workers-vpc/examples/)
119+
- Refer to [usage examples](/workers-vpc/examples/)

src/content/docs/workers-vpc/configuration/tunnel/hardware-requirements.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For production use cases, we recommend the following baseline configuration:
1414
- Run a cloudflared replica on two dedicated host machines per network location. Using two hosts enables server-side redundancy and traffic balancing.
1515
- Size each host with minimum 4GB of RAM and 4 CPU cores.
1616

17-
This setup is usually sufficient to handle traffic from small-medium sized applications. The actual amount of resources used by cloudflared will depend on many variables, including the number of requests per second, bandwidth, network path and hardware. As additional users are onboarded, or if network traffic increases beyond your existing tunnel capacity, you can scale your tunnel by adding an additional cloudflared host in that location.
17+
This setup is usually sufficient to handle traffic from small-medium sized applications. The actual amount of resources used by cloudflared will depend on many variables, including the number of requests per second, bandwidth, network path, and hardware. As additional users are onboarded, or if network traffic increases beyond your existing tunnel capacity, you can scale your tunnel by adding an additional cloudflared host in that location.
1818

1919
## Capacity calculator
2020

src/content/docs/workers-vpc/configuration/tunnel/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Cloudflare Tunnels can be created one of two ways:
2929
For Workers VPC, we recommend creating a remotely-managed tunnel through the dashboard. Follow the [Tunnels for Workers VPC dashboard setup guide](/workers-vpc/get-started/) to create your tunnel with provided installation commands shown in the dashboard.
3030

3131
For locally-managed tunnels, refer to the [`cloudflared` locally-managed tunnels](/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/) guide.
32+
3233
For manual installation, refer to the [`cloudflared` downloads page](/cloudflare-one/connections/connect-networks/downloads/) for platform-specific installation instructions.
3334

3435
:::note[Important Note]
@@ -42,7 +43,7 @@ Use Tunnels with Workers VPC when you want to access private APIs, private datab
4243

4344
:::note
4445

45-
[Ingress configurations](/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/configuration-file/) for locally-managed tunnels are specific to Zero Trust are not required for Workers VPC as routing is handled by the VPC Service configuration.
46+
[Ingress configurations](/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/configuration-file/) for locally-managed tunnels are specific to Zero Trust, and are not required for Workers VPC, as routing is handled by the VPC Service configuration.
4647

4748
:::
4849

src/content/docs/workers-vpc/configuration/vpc-services.mdx

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ VPC Services enforce that requests are routed to their intended service without
2222

2323
:::note
2424

25-
Workers VPC is currently in beta. Features and APIs may change before general availability. During the beta, Workers VPC is available for free to all Workers plans.
25+
Workers VPC is currently in beta. Features and APIs may change before general availability. While in beta, Workers VPC is available for free to all Workers plans.
2626

2727
:::
2828

29-
## VPC Service Configuration
29+
## VPC Service configuration
3030

3131
A VPC Service consists of:
3232

3333
- **Type**: Currently only `http` is supported (support for `tcp` coming soon)
3434
- **Tunnel ID**: The Cloudflare Tunnel that provides network connectivity
35-
- **Hostname or IPv4/IPv6 addresses**: The hostname, or IPv4 and/or IPv6 addresses to use to route to your service from the tunnel in your private network.
35+
- **Hostname or IPv4/IPv6 addresses**: The hostname, or IPv4 and/or IPv6 addresses to use to route to your service from the tunnel in your private network
3636
- **Ports**: HTTP and/or HTTPS port configuration (optional, defaults to 80/443)
3737

38-
## Configuration Example
38+
## Configuration example
3939

4040
The following is an example of a VPC Service for a service using custom HTTP and HTTPS ports, and both IPv4 and IPv6 addresses.
4141

@@ -83,7 +83,7 @@ The following is an example of a VPC Service for a service using custom HTTP and
8383

8484
## Workers binding configuration
8585

86-
Once you've created a VPC Service, you can bind it to your Worker:
86+
Once you have created a VPC Service, you can bind it to your Worker:
8787

8888
<WranglerConfig>
8989
```toml
@@ -95,22 +95,7 @@ binding = "PRIVATE_API"
9595
service_id = "5634563546"
9696
remote = true
9797

98-
````
99-
100-
```jsonc
101-
{
102-
"name": "my-worker",
103-
"main": "src/index.js",
104-
"services": [
105-
{
106-
"binding": "PRIVATE_API",
107-
"service_id": "5634563546",
108-
"remote": true
109-
}
110-
]
111-
}
112-
````
113-
98+
```
11499
</WranglerConfig>
115100

116101
You can have multiple service bindings:
@@ -132,34 +117,12 @@ binding = "INTERNAL_CACHE"
132117
service_id = "3412345678"
133118
remote = true
134119

135-
````
136-
137-
```jsonc
138-
{
139-
"services": [
140-
{
141-
"binding": "PRIVATE_API",
142-
"service_id": "5634563546",
143-
"remote": true
144-
},
145-
{
146-
"binding": "PRIVATE_DATABASE",
147-
"service_id": "7856789012",
148-
"remote": true
149-
},
150-
{
151-
"binding": "INTERNAL_CACHE",
152-
"service_id": "3412345678",
153-
"remote": true
154-
}
155-
]
156-
}
157-
````
120+
```
158121

159122
</WranglerConfig>
160123

161124
## Next steps
162125

163126
- Set up [Cloudflare Tunnel](/workers-vpc/configuration/tunnel/) for your environment
164127
- Learn about the [Service Binding API](/workers-vpc/api/)
165-
- View [examples](/workers-vpc/examples/) of common use cases
128+
- Refer to [examples](/workers-vpc/examples/) of common use cases

src/content/docs/workers-vpc/examples/private-api.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ title: Access private API
33
pcx_content_type: example
44
---
55

6-
import { Tabs, TabItem } from "~/components";
6+
import { Tabs, TabItem, WranglerConfig } from "~/components";
77

8-
:::note
9-
This example demonstrates how to access a private REST API that's not exposed to the public internet.
10-
:::
8+
This example demonstrates how to access a private REST API that is not exposed to the public internet.
119

1210
## Overview
1311

@@ -42,6 +40,7 @@ Note the service ID returned for the next step.
4240

4341
Update your `wrangler.toml`:
4442

43+
<WranglerConfig>
4544
```toml
4645
name = "private-api-gateway"
4746
main = "src/index.js"
@@ -54,12 +53,13 @@ service_id = "<YOUR_SERVICE_ID>"
5453
[vars]
5554
API_VERSION = "v2"
5655
```
56+
</WranglerConfig>
5757

5858
## 3. Implement the Worker
5959

6060
Create `src/index.js`:
6161

62-
```javascript
62+
```js title="index.js"
6363
export default {
6464
async fetch(request, env, ctx) {
6565
// Parse the incoming request
@@ -125,7 +125,7 @@ export default {
125125

126126
For more complex authentication, create a middleware pattern:
127127

128-
```javascript
128+
```js
129129
// middleware/auth.js
130130
export async function authenticate(request, env) {
131131
const authHeader = request.headers.get("Authorization");

src/content/docs/workers-vpc/examples/private-s3.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ title: Access private S3 bucket
33
pcx_content_type: example
44
---
55

6-
import { Tabs, TabItem } from "~/components";
6+
import { Tabs, TabItem, WranglerConfig } from "~/components";
77

8-
:::note
98
This example shows how to access an S3 bucket through a VPC endpoint without exposing it to the public internet.
10-
:::
119

1210
## Overview
1311

@@ -76,6 +74,7 @@ The VPC Service configuration handles the routing to S3 through your tunnel. The
7674

7775
Update `wrangler.toml`:
7876

77+
<WranglerConfig>
7978
```toml
8079
name = "private-s3-worker"
8180
main = "src/index.js"
@@ -89,12 +88,13 @@ service_id = "<YOUR_SERVICE_ID>"
8988
AWS_REGION = "us-east-1"
9089
S3_BUCKET = "my-private-bucket"
9190
```
91+
</WranglerConfig>
9292

9393
## 4. Implement S3 access with AWS Signature V4
9494

9595
Create `src/index.js`:
9696

97-
```javascript
97+
```js title="index.js"
9898
import { AwsClient } from "aws4fetch";
9999

100100
export default {

src/content/docs/workers-vpc/examples/route-across-private-services.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use Workers VPC to create a centralized gateway that:
1414

1515
## Code example
1616

17-
```javascript
17+
```js
1818
export interface Env {
1919
USER_SERVICE: PrivateNetworkService;
2020
ORDER_SERVICE: PrivateNetworkService;
@@ -24,7 +24,7 @@ export interface Env {
2424
export default {
2525
async fetch(request: Request, env: Env): Promise<Response> {
2626
const url = new URL(request.url);
27-
27+
2828
// Add authentication
2929
const authHeader = request.headers.get('Authorization');
3030
if (!authHeader?.startsWith('Bearer ')) {
@@ -39,7 +39,7 @@ export default {
3939
} else if (url.pathname.startsWith('/api/inventory')) {
4040
return env.INVENTORY_SERVICE.fetch(request);
4141
}
42-
42+
4343
return new Response('Not Found', { status: 404 });
4444
}
4545
};

0 commit comments

Comments
 (0)