This documentation is available to agents as Markdown at https://docs.synthesized.io/tdk/latest/user_guide/070_integrations/secret_management/secret_managers.md. For the complete documentation index, see llms.txt.

Secret Managers

Instead of a password, you can give the platform a reference to a secret in AWS Secrets Manager, Google Cloud Secret Manager or HashiCorp Vault. The platform fetches the value when it connects, so the password isn’t stored in a configuration file or with the data source.

How it works

A reference is a JSON object whose type names the secret manager, with the fields that identify the secret. For example:

{"type": "aws", "secret": "prod/tdk/input-password"}
  1. Turn on the secret manager with its setting, on the CLI or on Governor and its workers.

  2. Give the platform access to the secret manager, through the cloud’s usual credentials or Vault’s connection settings.

  3. Put references where you would put a user name or password: see Where references go.

Each secret’s value must be a UTF-8 string.

AWS Secrets Manager

Turn it on with SECRETS_AWS_SECRET_MANAGER_ENABLED=true. It defaults to the value of TDK_AWS_ENABLED.

{"type": "aws", "secret": "prod/tdk/input-password", "version": "<version-id>"}
Field Value

secret

The name or ARN of the secret.

version

Optional. The version ID. Without it, the AWSCURRENT version is used.

The platform finds AWS credentials through the AWS SDK credentials chain: environment variables, a profile, or the role of the instance, task or pod it runs in. Give that identity secretsmanager:GetSecretValue on the secrets it needs. When it’s on, the log shows AWS Secrets Manager enabled.

Google Cloud Secret Manager

Turn it on with SECRETS_GCP_SECRET_MANAGER_ENABLED=true.

{"type": "gcp", "project": "my-project", "secret": "tdk-input-password", "version": "latest"}
Field Value

project

The Google Cloud project ID.

secret

The secret ID.

version

Optional. The version ID. Without it, the latest version is used.

The platform finds Google Cloud credentials from the environment it runs in, or from the file that GOOGLE_APPLICATION_CREDENTIALS points to. When it’s on, the log shows Google Secret Manager enabled.

HashiCorp Vault

Turn it on with SECRETS_VAULT_SECRET_MANAGER_ENABLED=true.

{"type": "vault", "storage": "secret", "path": "tdk", "secret": "input-password", "versioned": "true", "version": "0"}
Field Value

storage

The secret storage, such as secret, database or cubbyhole.

path

The mount path of the secret.

secret

The name of the secret.

versioned

Optional. Whether the storage is versioned. false by default.

version

Optional. The version. 0, the default, is the current version.

Also set the Vault connection properties, such as vault.uri, vault.token and vault.ssl.*, and any other authentication settings Spring Vault supports. See the Spring Vault documentation. When it’s on, the log shows Vault Secrets Manager enabled.

Raw values

A raw reference holds the value itself, unencrypted. Use it for testing:

{"type": "raw", "value": "${SOURCE_PASSWORD}"}

Where references go

CLI options

The -secret options take a reference instead of the value: --input-username-secret, --input-password-secret, --output-username-secret and --output-password-secret.

SECRETS_AWS_SECRET_MANAGER_ENABLED=true \
tdk --config-file workflow.yaml \
  --input-url "jdbc:postgresql://db.example.com:5432/production" \
  --input-username tdk \
  --input-password-secret '{"type": "aws", "secret": "prod/tdk/input-password"}' \
  --output-url "jdbc:postgresql://db.example.com:5432/testing" \
  --output-username tdk \
  --output-password-secret '{"type": "aws", "secret": "test/tdk/output-password"}'
Inventory file

In an inventory file, user and password take a reference:

data_sources:
  input:
    url: jdbc:postgresql://db.example.com:5432/production
    read_only: true
    user:
      type: raw
      value: tdk
    password:
      type: aws
      secret: prod/tdk/input-password
  output:
    url: jdbc:postgresql://db.example.com:5432/testing
    user:
      type: raw
      value: tdk
    password:
      type: vault
      storage: secret
      path: tdk
      secret: output-password
Governor

A data source can keep its credentials in a secret manager instead of Governor’s database. Governor then stores the reference, not the password.

Check that it works

  • The log shows the "enabled" line for the secret manager when the CLI, Governor or a worker starts.

  • Run a workflow, or test a data source’s connection, to check that the platform can read the secret.