Skip to content

Commit

Permalink
fix independent deployment recipe (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikinsk authored Oct 4, 2024
1 parent 90a656b commit cc98a4e
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions docs/recipes/project-config/independent-connector-deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,29 @@ DataConnectorLink object is kept in sync with the connector.

### Step 1. Build the connector

Build and deploy your connector and note the URL of the deployed connector, say `<deployed-connector-url>`.
Build and deploy your connector and note the:
- Read url, say `<deployed-connector-read-url>`
- Write url, say `<deployed-connector-write-url>`
- Authorization header, say `Bearer <deployed-connector-token>`

### Step 2. Update connector URLs in the data connector link
For example, to build the connector on DDN:

Update the environment variables that correspond to the connector read and write URLs in the data connector link with
`<deployed-connector-url>`:
```bash title="Build connector on DDN using config at <subgraph-name>/connector/<connector-name>/connector.yaml"
ddn connector build create --connector <subgraph-name>/connector/<connector-name>/connector.yaml \
--project just-piranha-2515 \
--env-file .env.cloud
```

:::info

The `--project` and `--env-file` flags can be skipped if the keys `project` and `cloudEnvFile` are set in the context.

:::

### Step 2. Update connector URLs and Auth header in the data connector link

Update the environment variables that correspond to the connector read, write URLs and the Authorization header in the
data connector link:

```yaml title="For example: <subgraph-name>/metadata/<connector-link-name>.hml"
kind: DataConnectorLink
Expand All @@ -63,17 +80,22 @@ definition:
valueFromEnv: <CONNECTOR>_READ_URL
write:
valueFromEnv: <CONNECTOR>_WRITE_URL
headers:
Authorization:
valueFromEnv: <CONNECTOR>_AUTHORIZATION_HEADER
#highlight-end
headers: ...
schema:
...
```
Update the environment variables in the corresponding env file:
```env title="For example: .env.cloud"
...
#highlight-start
<CONNECTOR>_READ_URL=<deployed-connector-url>
<CONNECTOR>_WRITE_URL=<deployed-connector-url>
<CONNECTOR>_READ_URL="<deployed-connector-read-url>"
<CONNECTOR>_WRITE_URL="<deployed-connector-write-url>"
<CONNECTOR>_AUTHORIZATION_HEADER="Bearer <deployed-connector-token>"
#highlight-end
...
```
Expand Down

0 comments on commit cc98a4e

Please sign in to comment.