From b38dc877a2344811f38d530a9bc2261ffa82f7bd Mon Sep 17 00:00:00 2001 From: Neil Johnson Date: Mon, 2 Dec 2024 17:21:10 +0000 Subject: [PATCH] docs: Refine connection secret support section (#1358) * docs: Refine connection secret support section --- docs/connections.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/docs/connections.md b/docs/connections.md index 37844768..ead0fdd7 100644 --- a/docs/connections.md +++ b/docs/connections.md @@ -14,15 +14,36 @@ To do so simply add the GCS path to the environment i.e ## Using GCP Secret Manager DVT supports [Google Cloud Secret Manager](https://cloud.google.com/secret-manager) for storing and referencing secrets in your connection configuration. -If the secret-manager flags are present, the remaining connection flags should reference secret names instead of the secret itself. For example, -the following BigQuery connection references a secret with name 'dvt-project-id' stored in project MY-PROJECT. +If the secret-manager flags are present, any of the remaining connection flags can reference secret names instead of the secret itself. +Example 1: A BigQuery connection referencing a secret with name "dvt-project-secret" stored in project `my-project`: ``` data-validation connections add \ --secret-manager-type GCP \ - --secret-manager-project-id \ + --secret-manager-project-id my-project \ --connection-name bq BigQuery \ - --project-id 'dvt-project-id' + --project-id "dvt-project-secret" +``` + +Example 2: A PostgreSQL connection referencing a mixture of secrets (for `--host` and `--password`) stored in project `my-project` and simple string tokens: +``` +data-validation connections add \ + --secret-manager-type GCP \ + --secret-manager-project-id my-project \ + --connection-name pg Postgres \ + --host=pg-host-secret \ + --user=dvt_user \ + --password=dvt-password-secret \ + --database=mydatabase +``` + +Example 3: An entire Oracle URL stored as a secret with name "dvt-url-secret" stored in project `my-project`: +``` +data-validation connections add \ + --secret-manager-type GCP \ + --secret-manager-project-id my-project \ + --connection-name ora_uat Oracle \ + --url="dvt-url-secret" ``` ## List existing connections