Skip to content

Commit a612453

Browse files
committed
add some kinda docs
1 parent 11a6d0e commit a612453

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

packages/services/cdn-worker/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,72 @@ CF_BASE_PATH=http://localhost:4010
4343
```
4444

4545
This way, your local Hive instance will be able to send schema to the locally running CDN Worker.
46+
47+
### Deployment
48+
49+
There is two variants being built that can be deployed independently.
50+
51+
- `Cloudflare Worker`: `dist/index.worker.mjs`
52+
- `AWS Lambda`: `dist/index.lambda.mjs`
53+
54+
#### Cloudflare Worker
55+
56+
THe documentation is work in progress and will be improved in the future.
57+
58+
```
59+
type Env = {
60+
S3_ENDPOINT: string;
61+
S3_ACCESS_KEY_ID: string;
62+
S3_SECRET_ACCESS_KEY: string;
63+
S3_BUCKET_NAME: string;
64+
S3_SESSION_TOKEN?: string;
65+
66+
S3_MIRROR_ENDPOINT: string;
67+
S3_MIRROR_ACCESS_KEY_ID: string;
68+
S3_MIRROR_SECRET_ACCESS_KEY: string;
69+
S3_MIRROR_BUCKET_NAME: string;
70+
S3_MIRROR_SESSION_TOKEN?: string;
71+
72+
SENTRY_DSN: string;
73+
/**
74+
* Name of the environment, e.g. staging, production
75+
*/
76+
SENTRY_ENVIRONMENT: string;
77+
/**
78+
* Id of the release
79+
*/
80+
SENTRY_RELEASE: string;
81+
/**
82+
* Worker's Analytics Engines
83+
*/
84+
USAGE_ANALYTICS: AnalyticsEngine;
85+
ERROR_ANALYTICS: AnalyticsEngine;
86+
RESPONSE_ANALYTICS: AnalyticsEngine;
87+
R2_ANALYTICS: AnalyticsEngine;
88+
S3_ANALYTICS: AnalyticsEngine;
89+
KEY_VALIDATION_ANALYTICS: AnalyticsEngine;
90+
/**
91+
* Base URL of the KV storage, used to fetch the schema from the KV storage.
92+
* If not provided, the schema will be fetched from default KV storage value.
93+
*
94+
* @default https://key-cache.graphql-hive.com
95+
*/
96+
KV_STORAGE_BASE_URL?: string;
97+
};
98+
```
99+
100+
#### AWS Lambda
101+
102+
**Runtime**: Node.js 22.x
103+
104+
| Name | Required | Description | Example Value |
105+
| --------------------------- | -------- | ------------------------------------ | ------------- |
106+
| `AWS_S3_ACCESS_KEY_ID` | **Yes** | The port this service is running on. | `4013` |
107+
| `AWS_S3_ACCESSS_KEY_SECRET` | **Yes** | The port this service is running on. | `4013` |
108+
| `AWS_S3_ACCESS_ENDPOINT` | **Yes** | The port this service is running on. | `4013` |
109+
| `AWS_S3_BUCKET_NAME` | **Yes** | The port this service is running on. | `4013` |
110+
111+
All other configuration options available for Cloudflare Workers are currently not supported.
112+
113+
We recommend deploying the function to AWS Lambda, create a AWS Lambda Function invocation URL and
114+
then add the function as origin to CloudFront.

0 commit comments

Comments
 (0)