adds highlighting to `locals` stanza (#10881)

This commit is contained in:
Kerim Satirli 2021-04-07 16:38:23 +02:00 committed by GitHub
parent eaec3e5564
commit e3bcb4f2ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -120,14 +120,15 @@ by using a for expression rather than by using template directives.
If the resulting template is small, you can choose instead to write jsonencode or yamlencode calls inline in your main configuration files, and avoid creating separate template files at all:
```hcl
locals {
backend_config_json = jsonencode({
"backends": [for addr in ip_addrs : "${addr}:${port}"],
})
backend_config_json = jsonencode({
"backends": [for addr in ip_addrs : "${addr}:${port}"],
})
}
For more information, see the main documentation for jsonencode and yamlencode.
```
»
For more information, see the main documentation for jsonencode and yamlencode.
## Related Functions