From 98e7099c343fbdd00eec94d55e0008a3c167ea51 Mon Sep 17 00:00:00 2001 From: Jonathan Ruckwood Date: Thu, 3 Oct 2024 15:52:42 +0100 Subject: [PATCH 1/2] Add configuration for addressing Redshift servers Adds clusterIdentifier, host, port and endpoint to give more options for addressing a Redshift output port. Add documentation and examples to README. --- CHANGELOG.md | 1 + README.md | 51 +++++++++++++++++++++++++++++++++++----- datacontract.schema.json | 32 ++++++++++++++++++++++++- 3 files changed, 77 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78c9312..4ad692c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The public API SHOULD NOT be considered stable. - Trino support - Field `type: map` support with properties `keys` and `values` - Definitions: `fields`, for type `object`, `record`, and `struct` +- Add Redshift server properties `clusterIdentifier`, `endpoint`, `host` and `port`. ## [0.9.3] - 2024-03-06 diff --git a/README.md b/README.md index a419951..a00a8cf 100644 --- a/README.md +++ b/README.md @@ -409,12 +409,51 @@ servers: #### Redshift Server Object -| Field | Type | Description | -|----------|----------|-------------| -| type | `string` | `redshift` | -| account | `string` | | -| database | `string` | | -| schema | `string` | | +| Field | Type | Description | +|-------------------|----------|---------------------------------------------------------------------------------------------------------------------| +| type | `string` | `redshift` | +| account | `string` | | +| database | `string` | | +| schema | `string` | | +| clusterIdentifier | `string` | Identifier of the cluster.
Example: `analytics-cluster` | +| host | `string` | Host of the cluster.
Example: `analytics-cluster.example.eu-west-1.redshift.amazonaws.com` | +| port | `number` | Port of the cluster.
Example: `5439` | +| endpoint | `string` | Endpoint of the cluster
Example: `analytics-cluster.example.eu-west-1.redshift.amazonaws.com:5439/analytics` | + +Example, specifying an endpoint: + +```yaml +servers: + analytics: + type: redshift + schema: analytics + endpoint: analytics-cluster.example.eu-west-1.redshift.amazonaws.com:5439/analytics +``` + +Example, specifying the cluster identifier: + +```yaml +servers: + analytics: + type: redshift + account: '123456789012' + clusterIdentifier: analytics-cluster + database: analytics + port: 5439 + schema: analytics +``` + +Example, specifying the cluster host: + +```yaml +servers: + analytics: + type: redshift + host: analytics-cluster.example.eu-west-1.redshift.amazonaws.com + database: analytics + port: 5439 + schema: analytics +``` #### Azure Server Object diff --git a/datacontract.schema.json b/datacontract.schema.json index 844afc4..3442f00 100644 --- a/datacontract.schema.json +++ b/datacontract.schema.json @@ -272,6 +272,10 @@ "type": "string", "description": "An optional string describing the server." }, + "host": { + "type": "string", + "description": "An optional string describing the host name." + }, "database": { "type": "string", "description": "An optional string describing the server." @@ -279,14 +283,40 @@ "schema": { "type": "string", "description": "An optional string describing the server." + }, + "clusterIdentifier": { + "type": "string", + "description": "An optional string describing the cluster's identifier.", + "examples": [ + "redshift-prod-eu", + "analytics-cluster" + ] + }, + "port": { + "type": "integer", + "description": "An optional string describing the cluster's port.", + "examples": [ + 5439 + ] + }, + "endpoint": { + "type": "string", + "description": "An optional string describing the cluster's endpoint.", + "examples": [ + "analytics-cluster.example.eu-west-1.redshift.amazonaws.com:5439/analytics" + ] } }, "additionalProperties": true, "required": [ "type", "account", + "host", "database", - "schema" + "schema", + "clusterIdentifier", + "port", + "endpoint" ] }, { From 544a9463da1511f8b152e77f1c1dd690c39181b7 Mon Sep 17 00:00:00 2001 From: Jonathan Ruckwood Date: Wed, 9 Oct 2024 11:07:59 +0100 Subject: [PATCH 2/2] Correct required properties Tidy up examples, make them consistent. --- README.md | 10 ++++++---- datacontract.schema.json | 6 +----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a00a8cf..26fd7cd 100644 --- a/README.md +++ b/README.md @@ -426,6 +426,8 @@ Example, specifying an endpoint: servers: analytics: type: redshift + account: '123456789012' + database: analytics schema: analytics endpoint: analytics-cluster.example.eu-west-1.redshift.amazonaws.com:5439/analytics ``` @@ -437,10 +439,9 @@ servers: analytics: type: redshift account: '123456789012' - clusterIdentifier: analytics-cluster database: analytics - port: 5439 schema: analytics + clusterIdentifier: analytics-cluster ``` Example, specifying the cluster host: @@ -449,10 +450,11 @@ Example, specifying the cluster host: servers: analytics: type: redshift - host: analytics-cluster.example.eu-west-1.redshift.amazonaws.com + account: '123456789012' database: analytics - port: 5439 schema: analytics + host: analytics-cluster.example.eu-west-1.redshift.amazonaws.com + port: 5439 ``` #### Azure Server Object diff --git a/datacontract.schema.json b/datacontract.schema.json index 3442f00..924f165 100644 --- a/datacontract.schema.json +++ b/datacontract.schema.json @@ -311,12 +311,8 @@ "required": [ "type", "account", - "host", "database", - "schema", - "clusterIdentifier", - "port", - "endpoint" + "schema" ] }, {