Skip to main content

Vault Connector

1. Overview​

The Vault Connector (vault) component allows you to read or write secrets in a HashiCorp Vault or OpenBao Key-Value (KV) engine.

It supports both KV v1 (static) and KV v2 (versioned) engines, handling API differences transparently. The component works only as an output action, meaning it cannot be used as an input trigger.

Use it when the flow needs to retrieve sensitive credentials (database passwords, API keys) or store protected information securely.

2. Prerequisites​

  • A Vault or OpenBao instance accessible by the platform.
  • A Key-Value (KV) secret engine enabled in Vault.
  • Credentials (Token or AppRole) with appropriate permissions on the desired path.

3. Authentication and Connection​

The connector supports two authentication methods: AppRole (recommended for services) and Token.

FieldRequiredTypeDescriptionExample
addressYesTextFull URL of the Vault/OpenBao instance."https://vault.example.com"
authMethodNoTextAuthentication method: approle or token. Default: "approle"."approle"
tokenYes*TextVault Token. Required if authMethod is token."hvs.CAES..."
roleIdYes**TextAppRole Role ID. Required if authMethod is approle."0a52..."
secretIdYes**TextAppRole Secret ID. Required if authMethod is approle."1e2b..."
tlsSkipVerifyNoTextIf "true", ignores SSL certificate validation (not recommended in production)."false"
caCertNoTextCA certificate in PEM format to validate HTTPS connections."-----BEGIN CERTIFICATE-----..."

Tip: Use platform secrets to store tokens and AppRole credentials, referencing them in the component with {$.secrets.secret_name}.

4. Configuration / Supported Operations​

The component has two main operations: read and write.

Common Parameters​

FieldRequiredTypeDescriptionExample
operationNoTextOperation to perform: read or write. Default: "read"."read"
mountYesTextKV engine mount point in Vault."secret"
pathYesTextSecret path within the mount."myapp/config"
kvVersionNoTextKV engine version: v1 or v2. Default: "v2"."v2"

Operation: Read​

Retrieves a secret from Vault.

FieldRequiredTypeDescriptionExample
keyNoTextIf filled, returns only this key's value. If empty, returns the entire secret object."password"
cacheTtlNoNumberTime in seconds to cache the read value, avoiding repetitive calls to Vault.60

Operation: Write​

Creates or updates keys in a secret. Important: Writing in the connector is non-destructive by default (it does not remove keys not listed).

FieldRequiredTypeDescriptionExample
overwriteNoTextIf "true", updates existing keys. If "false", fails if any listed key already exists. Default: "false"."true"
dataModeNoTextData sending mode: fields (object) or raw (JSON string). Default: "fields"."fields"
dataYes***ObjectKey/value map to write (used in fields mode).{"api_key": "123"}
dataRawYes***TextJSON string representing the object to be written (used in raw mode).{"db_user": "admin"}

*** Required depending on the chosen dataMode.

5. Practical Examples​

Reading a database password​

Finds the password key in the secret located at secret/myapp/database.

Component configuration:

{
"componentName": "vault",
"configurations": {
"operation": "read",
"authMethod": "approle",
"address": "https://vault.internal:8200",
"roleId": "{$.secrets.vaultRoleId}",
"secretId": "{$.secrets.vaultSecretId}",
"mount": "secret",
"path": "myapp/database",
"key": "password",
"kvVersion": "v2"
}
}

Response:

{
"data": {
"password": "super-secure-password"
},
"metadata": {
"version": 3,
"created_time": "2024-08-20T15:00:00Z"
}
}

Writing multiple fields (Upsert)​

Updates or creates the token and expires_at keys at the path secret/myapp/integration, preserving other keys already present in the same secret.

Component configuration:

{
"componentName": "vault",
"configurations": {
"operation": "write",
"overwrite": "true",
"authMethod": "token",
"address": "{$.env.vault_url}",
"token": "{$.secrets.vaultToken}",
"mount": "secret",
"path": "myapp/integration",
"dataMode": "fields",
"data": {
"token": "{$.body.newToken}",
"expires_at": "2024-12-31"
}
}
}

6. Common Errors and Troubleshooting​

Error / SymptomLikely CauseHow to Solve
Vault is sealed or unavailableVault is in the "sealed" state or network unreachable.Check Vault status and connectivity.
Permission deniedToken or AppRole lacks capabilities (read, create, update, patch) on the path.Review policies associated with the credential. For overwrite: true in KV v2, patch permission is required.
Key(s) [...] already existWrite attempt with overwrite: false on existing keys.Change overwrite to "true" or ensure the key is new.
Configuration 'address' is requiredOne of the mandatory parameters is missing (address, mount, or path).Review the component configuration.
A write operation requires at least one key/valueWrite attempt without providing data in data or dataRaw.Provide the fields to be written.