New! – Spin up instant copies of your dev databases in the cloud for free Learn more

Flyway Documentation

Poll

Vault Secrets

Flyway Teams

Description

A comma-separated list of paths to key-value secrets in Vault that contain Flyway configurations. This must start with the name of the engine and end with the name of the secret.

The resulting form is {engine_name}/data/{path}/{to}/{secret_name} for the key-value V2 engine, and {engine_name}/{path}/{to}/{secret_name} for the key-value V1 engine. If multiple secrets specify the same configuration parameter, then the last secret takes precedence.

Example: kv/data/flyway/flywayConfig

Usage

Commandline

./flyway -vault.secrets="kv/data/flyway/flywayConfig1,kv/flyway/flywayConfig2" info

Configuration File

flyway.vault.secrets=kv/data/flyway/flywayConfig1,kv/flyway/flywayConfig2

Environment Variable

FLYWAY_VAULT_SECRETS=kv/data/flyway/flywayConfig1,kv/flyway/flywayConfig2

API

Configuration configuration = new ClassicConfiguration();
VaultApiExtension apiExtension = configuration.getExtensionConfiguration(VaultApiExtension.class);
apiExtension.setVaultSecrets("kv/data/flyway/flywayConfig1", "kv/flyway/flywayConfig2");

Gradle

flyway {
    vaultConfiguration {
        vaultSecrets = ['kv/data/flyway/flywayConfig1', 'kv/flyway/flywayConfig2']
    }
}

Maven

<configuration>
    <vaultConfiguration>
        <vaultSecrets>
            <vaultSecret>kv/data/flyway/flywayConfig1</vaultSecret>
            <vaultSecret>kv/flyway/flywayConfig2</vaultSecret>
        </vaultSecrets>
    </vaultConfiguration>
</configuration>