A city automation service must use different DNA Center hostnames and feature flags in lab versus production. Which 12-factor approach keeps that deploy-specific config out of the repository?
Select an answer to reveal the explanation.
Short Explanation
Config is like changing the destination on a delivery van without rebuilding the van. Environment injection swaps hostnames and flags per deploy; checking in prod_config.py with passwords nails the wrong address into the source tree.
Full Explanation
Configuration for hostnames, feature flags, and credentials should arrive per deploy from the environment or the platform’s config injection. The same build artifact then serves lab and production civic controllers by swapping injected values, which keeps secrets out of source and avoids rebuilds for endpoint changes. Committing prod_config.py with the controller password fails confidentiality and portability: every clone becomes a credential leak and lab runs risk hitting production DNA or Meraki endpoints. Baking lab and production endpoints as compile-time constants in separate binaries multiplies artifacts and forces a rebuild whenever topology changes, conflating config with code. Storing only production values in git and asking developers to hand-edit before each lab run invites human error, drift, and accidental production writes from a laptop. Exam caveat: environment injection still needs a secret store and least-privilege mounts—plain env vars in manifests can leak via process listings and crash dumps. Operational check: deploy the identical image to lab with lab URLs injected, confirm no production hostnames appear in the process environment, then promote the same digest to production with production injection only.