Code that checks if ENV == "prod" has to be edited and rebuilt for every new environment. The twelve-factor rule says config, meaning anything that changes between deploys, lives outside the code. Follow it when you want one image that passed staging to be promoted to prod unchanged. Settings that never vary per deploy, like route tables, can stay in code.