It's not either or. A config file checked into git and applied by a CI/CD pipeline is infrastructure as code.
Config files work fine. But so does expressive code with the right abstractions. And I think code scales up better and down almost as well. Just my opinion.