Merge pull request #1758 from hashicorp/hugoamvieira-env-file-workertags
feat(config): Add env and file support to Worker Tags
This commit is contained in:
5 files changed
+390
-3
No files matched your search
@@ -53,6 +53,53 @@ worker {
|
||||
|
||||
In this format, it is not possible to have an equal sign be a part of the key.
|
||||
|
||||
It is also possible to set the entire `tags` block or the keys' values within
|
||||
to point to an environment variable or filepath in the system, through the
|
||||
`env://` and `file://` URLs:
|
||||
|
||||
```hcl
|
||||
worker {
|
||||
name = "web-prod-us-east-1"
|
||||
tags = "env://BOUNDARY_ALL_WORKER_TAGS"
|
||||
}
|
||||
```
|
||||
|
||||
```hcl
|
||||
worker {
|
||||
name = "web-prod-us-east-1"
|
||||
tags {
|
||||
type = "env://BOUNDARY_WORKER_TYPE_TAGS"
|
||||
region = "file://config/worker/region_tags"
|
||||
usage = ["admin"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Note that the syntax within the environment variable / file changes
|
||||
slightly depending on how the configuration file is set:
|
||||
|
||||
For setting the entire `tags` block, both the keys and values need
|
||||
to be specified, in JSON or HCL format:
|
||||
|
||||
```json
|
||||
{
|
||||
"region": ["us-east-1"],
|
||||
"type": ["prod", "webservers"]
|
||||
}
|
||||
```
|
||||
|
||||
```hcl
|
||||
region = ["us-east-1"]
|
||||
type = ["prod", "webservers"]
|
||||
```
|
||||
|
||||
For setting the keys' values within the `tags` block, only a JSON
|
||||
array with the tags intended for the particular key is required:
|
||||
|
||||
```json
|
||||
["prod", "webservers"]
|
||||
```
|
||||
|
||||
# Target Worker Filtering
|
||||
|
||||
Once workers have tags, it is possible to use these tags to control which
|
||||
|
||||
@@ -39,7 +39,8 @@ worker {
|
||||
- `tags` - A map of key-value pairs where values are an array of strings. Most
|
||||
commonly used for [filtering](/docs/concepts/filtering) targets a worker can
|
||||
proxy via [worker tags](/docs/concepts/filtering/worker-tags). On `SIGHUP`, the
|
||||
tags set here will be re-parsed and new values used..
|
||||
tags set here will be re-parsed and new values used. It can also be a string
|
||||
referring to a file on disk (file://) or an env var (env://).
|
||||
|
||||
## KMS Configuration
|
||||
|
||||
|
||||
Reference in new issue
Block a user