Store configuration in the environment.

  • Configuration is anything that is likely to very between deploys:
    • Resource handles to a Databases or Cache
    • Credentials for external services (like storage or dependencies).
    • Pre-deploy values like hostnames.
  • Strict separation of configuration from code; no configuration stored in constants.
  • Good litmus test: could we open source this today without compromising credentials?
  • Use of files not checked into version control alongside code is best practice.
  • We can take this further: all configuration is stored as environment variables.
    • These are managed as granular controls and are not grouped, as grouping can make the configuration brittle over time.