Skip to content

Instantly share code, notes, and snippets.

Last active April 17, 2020 21:20
What would you like to do?
Loading data values from a JSON file

JSON is valid YAML. That is, YAML syntax is a superset of JSON syntax.

So, YAML parsers naturally parse JSON.

$ ytt --data-value-yaml "stable_config=$( cat stable_config.json )" -f cluster-template-paving.yaml -f values.yml

Note: the values.yml needs to be present for ytt at the time of writing because data values specified on the command-line are each applied as an overlay with default matching (i.e. matches exactly one node).

#@ load("@ytt:data", "data")
foo: #@ data.values.stable_config.vpc_id
stable_config: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment