Skip to content

Commit 7af657e

Browse files
authored
Merging to release-5.10: docs(DX-2061): add environment variable type mapping documentation (#1134)
docs(DX-2061): add environment variable type mapping documentation (#1134)
1 parent 46222fd commit 7af657e

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: "Environment Variables and Configs"
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
@@ -5,9 +5,11 @@ order: 3
55
sidebarTitle: "Tyk Identity Broker"
66
---
77

8+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
9+
810
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.
911

10-
#### The `tib.conf` file
12+
### The `tib.conf` file
1113

1214
```{.copyWrapper}
1315
{
@@ -56,6 +58,8 @@ From TIB v1.3.1, the environment variable `TYK_IB_OMITCONFIGFILE` is provided to
5658
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.
5759
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.
5860

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

6165
### secret

tyk-dashboard/configuration.mdx

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

88
import DashboardConfig from '/snippets/dashboard-config.mdx';
9+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
910

1011
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.
1112
To understand how the environment variables notation works, see [Environment Variables](/tyk-oss-gateway/configuration).
@@ -20,6 +21,8 @@ Please consult the [data storage configuration](/api-management/dashboard-config
2021

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

24+
<EnvTypeMapping/>
25+
2326
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.
2427

2528
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
@@ -6,12 +6,15 @@ sidebarTitle: "Gateway"
66
---
77

88
import GatewayConfig from '/snippets/gateway-config.mdx';
9+
import EnvTypeMapping from '/snippets/env-type-mapping.mdx';
910

1011
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.
1112
To understand how the environment variables notation works, see [Environment Variables](/tyk-oss-gateway/configuration).
1213

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

16+
<EnvTypeMapping/>
17+
1518
### tyk lint
1619

1720
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)