Skip to content

Commit 57a0e02

Browse files
authored
Merging to release-5.8: docs(DX-2061): add environment variable type mapping documentation (#1134)
docs(DX-2061): add environment variable type mapping documentation (#1134)
1 parent d69a963 commit 57a0e02

File tree

7 files changed

+38
-1
lines changed

7 files changed

+38
-1
lines changed

product-stack/tyk-enterprise-developer-portal/deploy/configuration.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ keywords: "Configure Tyk Enterprise Developer Portal, Tyk Enterprise Developer P
55
sidebarTitle: "Enterprise Developer Portal"
66
---
77

8+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
9+
810
To configure the Tyk Enterprise Developer Portal, you can use either a config file or environment variables.
911
The table below provides a reference to all options available to you when configuring the portal.
12+
13+
<EnvTypeMapping/>
14+
1015
## Portal settings
1116
This section explains the general portal settings, including which port it will be listening on, how often it should synchronize API Products and plans with the Tyk Dashboard, and so on.
1217
Most of these settings are optional, except for the PORTAL_LICENSEKEY. If you don't specify these settings, the default values will be used.

snippets/env-type-mapping.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### Environment Variable Type Mapping
2+
3+
When configuring Tyk components using environment variables, it's important to understand how different data types are represented. The type of each variable is based on its definition in the Go source code. This section provides a guide on how to format values for common data types.
4+
5+
| Go Type | Environment Variable Format | Example |
6+
| ----------------------- | ---------------------------------- | -------------------------------------------------------------------- |
7+
| `string` | A regular string of text. | `TYK_GW_SECRET="mysecret"` |
8+
| `int`, `int64` | A whole number. | `TYK_GW_LISTENPORT=8080` |
9+
| `bool` | `true` or `false`. | `TYK_GW_USEDBAPPCONFIG=true` |
10+
| `[]string` | A comma-separated list of strings. | `TYK_PMP_PUMPS_STDOUT_FILTERS_SKIPPEDAPIIDS="api1,api2,api3"` |
11+
| `map[string]string` | A comma-separated list of key:value pairs. | `TYK_GW_GLOBALHEADERS="X-Tyk-Test:true,X-Tyk-Version:1.0"` |
12+
| `map[string]interface{}` | A JSON string representing the object. | `TYK_GW_POLICIES_POLICYSOURCE_CONFIG='{"connection_string": "..."}'` |
13+
14+
<Note>
15+
For complex types like `map[string]interface{}`, the value should be a valid JSON string. For `[]string` and `map[string]string`, ensure there are no spaces around the commas unless they are part of the value itself.
16+
</Note>

tyk-configuration-reference/tyk-identity-broker-configuration.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ order: 3
44
sidebarTitle: "Tyk Identity Broker"
55
---
66

7+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
8+
79
The Tyk Identity Broker (TIB) is configured through two files: The configuration file `tib.conf` and the profiles file `profiles.json`. TIB can also be managed via the [TIB REST API](/tyk-identity-broker/tib-rest-api) for automated configurations.
810

9-
#### The `tib.conf` file
11+
### The `tib.conf` file
1012

1113
```{.copyWrapper}
1214
{
@@ -55,6 +57,8 @@ From TIB v1.3.1, the environment variable `TYK_IB_OMITCONFIGFILE` is provided to
5557
If set to TRUE, then TIB will ignore any provided configuration file and set its parameters according to environment variables. TIB will fall back to the default value for any parameters not set in an environment variable.
5658
This is particularly useful when using Docker, as this option will ensure that TIB will load the configuration via env vars and not expect a configuration file.
5759

60+
<EnvTypeMapping/>
61+
5862
The various options for `tib.conf` file are:
5963

6064
### secret

tyk-dashboard/configuration.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebarTitle: "Dashboard"
55
---
66

77
import DashboardConfig from '/snippets/dashboard-config.mdx';
8+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
89

910
You can use environment variables to override the config file for the Tyk Dashboard. The Dashboard configuration file can be found in the `tyk-dashboard` folder and by default is called `tyk_analytics.conf`, though it can be renamed and specified using the `--conf` flag. Environment variables are created from the dot notation versions of the JSON objects contained with the config files.
1011
To understand how the environment variables notation works, see [Environment Variables](/tyk-oss-gateway/configuration).
@@ -19,6 +20,8 @@ Please consult the [data storage configuration](/api-management/dashboard-config
1920

2021
All the Dashboard environment variables have the prefix `TYK_DB_`. The environment variables will take precedence over the values in the configuration file.
2122

23+
<EnvTypeMapping/>
24+
2225
Environment variables (env var) can be used to override the settings defined in the configuration file. Where an environment variable is specified, its value will take precedence over the value in the configuration file.
2326

2427
The file will look like the sample below, the various fields are explained in the following sections:

tyk-multi-data-centre/mdcb-configuration-options.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ sidebarTitle: "Multi Data Center Bridge"
77
---
88

99
import MdcbConfig from '/snippets/mdcb-config.mdx';
10+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
1011

1112
## Tyk MDCB Configuration
1213

@@ -16,6 +17,8 @@ The Tyk MDCB server is configured primarily via the `tyk_sink.conf` file, this f
1617

1718
Environment variables (env var) can be used to override the settings defined in the configuration file. Where an environment variable is specified, its value will take precedence over the value in the configuration file.
1819

20+
<EnvTypeMapping/>
21+
1922
### Default Ports
2023

2124
| Application | Port |

tyk-oss-gateway/configuration.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ sidebarTitle: "Gateway"
55
---
66

77
import GatewayConfig from '/snippets/gateway-config.mdx';
8+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
89

910
You can use environment variables to override the config file for the Tyk Gateway. The Gateway configuration file can be found in the `tyk-gateway` folder and by default is called `tyk.conf`, though it can be renamed and specified using the `--conf` flag. Environment variables are created from the dot notation versions of the JSON objects contained with the config files.
1011
To understand how the environment variables notation works, see [Environment Variables](/tyk-oss-gateway/configuration).
1112

1213
All the Gateway environment variables have the prefix `TYK_GW_`. The environment variables will take precedence over the values in the configuration file.
1314

15+
<EnvTypeMapping/>
16+
1417
### tyk lint
1518

1619
In **v2.4** we have added a new `tyk lint` command which will validate your `tyk.conf` file and validate it for syntax correctness, misspelled attribute names or format of values. The Syntax can be:

tyk-pump/tyk-pump-configuration/tyk-pump-environment-variables.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ sidebarTitle: "Pump"
77
---
88

99
import PumpConfig from '/snippets/pump-config.mdx';
10+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
1011

1112
You can use environment variables to override the config file for the Tyk Pump. Environment variables are created from the dot notation versions of the JSON objects contained with the config files.
1213
To understand how the environment variables notation works, see [Environment Variables](/tyk-oss-gateway/configuration).
1314

1415
All the Pump environment variables have the prefix `TYK_PMP_`. The environment variables will take precedence over the values in the configuration file.
1516

17+
<EnvTypeMapping/>
18+
1619
<PumpConfig/>

0 commit comments

Comments
 (0)