Configuration Topics

The following sections describe common topics when working with Ciris and configurations as code.

  • Encoding Validation describes how to use refinement types to encode validation in the types of your configuration, for increased safety and confidence in your configurations. Validating your configuration values is a critical factor in preventing latent errors, as being able to detect configuration errors early on can reduce failure damage1.
  • Multiple Environments explains how to use enumeratum enumerations to model and work with multiple environments in your configurations. This includes being able to have different configuration values for different environments, and being able to change the configuration loading process depending on the environment.
  • Logging Configurations shows how you can log your configurations for debug purposes, while not exposing any secret configuration values. This is done with a Secret wrapper type, and either just print, or with the Show type class from cats, together with type class instance derivation from kittens.

  1. For example, refer to the paper Early Detection of Configuration Errors to Reduce Failure Damage and Leif Wickland’s presentation Defusing the Configuration Time Bomb on the subject of configuration errors and validation.