YAML

A human-friendly text format for configuration, where indentation shows structure.

In more detail

Indentation is significant and must use spaces, not tabs, so most YAML mistakes are alignment mistakes. A line starting with a dash is a list item, key: value makes a mapping, and three dashes mark the start of a document.

Examples

Playbooks, YAML inventories and variable files are YAML; quote file modes such as "0644" so they are not read as numbers.
In the APIs course: The course contract, openapi.yaml, is written in YAML.
packages:
  - "apps/*"   # pnpm-workspace.yaml
prometheus.yml and collector.yaml are both YAML.
Sigma rules and Kubernetes audit policies are written in YAML.
In Terraform: CI workflow files, including the course's GitHub Actions pipeline, are written in YAML. Terraform itself uses HCL, but can read and write YAML with the yamldecode and yamlencode functions.
In this course: API descriptions such as OpenAPI documents and pipeline workflow files are often written in YAML. Indentation carries meaning in YAML, so a misplaced space changes the structure.

Related terms

Taught in

References

Certification courses