added some discussion of HCL parsing context

This commit is contained in:
Chris Baker 2020-12-02 20:41:53 +00:00
parent 1e8cab2eec
commit e1010c9227
1 changed files with 11 additions and 0 deletions

View File

@ -29,6 +29,17 @@ a quick try to HCL2, you can also read the quicker [HCL2 getting started
guide](/guides/hcl). guide](/guides/hcl).
---> --->
## HCL Parsing Context
It is important to acknowledge that the Nomad API uses JSON to represent Nomad jobs.
When running commands like `nomad job run` and `nomad job plan`, the Nomad CLI
parses HCL and ultimately converts it to JSON. Because this parsing happens locally
(i.e., where the operator is running the CLI) before job submission, there are some
limits to the capabilities that can be accessed by HCL job specifications. For
example, scheduling information is not yet available, including information about
the client. Similarly, HCL features that depend on external context will take that
context from the local environment of the CLI (e.g., files, environment variables).
## Syntax ## Syntax
The main purpose of the HCL language in Nomad is defining jobs. All other The main purpose of the HCL language in Nomad is defining jobs. All other