# Anchors, aliases and merge keys
# Free sample from 99helpers.com/file-types/yaml

# 1. A plain anchor and alias: both keys get the same value
primary_colour: &brand "#1E66F5"
link_colour: *brand

# 2. An anchored mapping, reused whole
default_db: &db
  host: db.example.internal
  port: 5432
  pool: 5

reporting_db: *db              # an identical copy

# 3. Merge keys: copy the keys, then override some
staging_db:
  <<: *db
  host: staging-db.example.internal

# 4. Merging several mappings: earlier ones win on conflicts
base: &base
  timeout: 30
  retries: 3
fast: &fast
  timeout: 5
service:
  <<: [*fast, *base]
  name: search                 # timeout 5, retries 3

# 5. An anchored sequence, reused
regions: &regions [eu-west, eu-north, us-east]
backup_regions: *regions
