Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Variables and templating

Config values are handlebars templates. Declare variables under vars and secrets under secrets; secrets are decrypted before expansion.

  • Works in most values, not in YAML keys.
  • Works inside vars, for variables defined earlier in the document.
  • Does not work inside secrets: a secret’s value is used verbatim, so a {{ in it stays text.
  • A key is either a var or a secret, not both.
secrets:
  sqlPassword: '-----BEGIN AGE ENCRYPTED FILE-----|YWdlLWVuY3J ... truncated'

vars:
  sqlUser: admin
  sqlConnectionString: "uid={{ sqlUser }};pwd={{ sqlPassword }}"

env:
  SQL_CONNECTION_A: "database=A;{{ sqlConnectionString }}"
  SQL_CONNECTION_B: "database=B;{{ sqlConnectionString }}"

sidecars:
  tool:
    env:
      SQL_USER: "{{ sqlUser }}"
      SQL_PASSWORD: "{{ sqlPassword }}"