tyk.conf
) by adding the kv
section as follows:
Key | Description |
---|---|
address | The address of the Vault server, which must be a complete URL such as http://www.vault.example.com |
agent_address | The address of the local Vault agent, if different from the Vault server, must be a complete URL |
max_retries | The maximum number of attempts Tyk will make to retrieve the value if Vault returns an error |
timeout | The maximum time that Tyk will wait for a response from Vault (in nanoseconds, if set to 0 (default) will be interpreted as 60 seconds) |
token | The Vault root access token |
kv_version | The version number of Vault, usually defaults to 2 |
secret.key
) to access the value from a specific key within a secret.
tyk
with a key gw
and value 123
in Vault then, from the command line, you would:
kv
secrets engine in Vault under the path my-secret
using:vault secrets enable -version=2 -path=my-secret kv
tyk
with the key gw
and value 123
in Vault:vault kv put my-secret/tyk gw=123
/data
to the secret path):
excited
and foo
):
TYK_GW_SECRET=vault://my-secret/tyk.gw
string
field in the API definition. For these you should create a folder named tyk-apis
in the root of your Vault KV store and store all secrets in a flat structure there (sub-directories not currently supported). You should not include the tyk-apis
path in the reference so, for example, given a key-value pair "foo":"bar"
stored in a secret named my-secret
in /tyk-apis
in Vault, you would reference this from the API definition using vault://my-secret.foo
.
tyk.conf
) you can retrieve values from Vault using the following notation:
vault://path/to/secret.KEY
vault://path/to/secret.KEY
$secret_vault.KEY
string
field in the API definition in the Vault KV store. You can retrieve these values from Vault, noting that you do not provide the directory path (/tyk-apis
) when accessing data for these fields, using the following notation:
vault://KEY