Config attributes (the IP addresses, the names, the values) belong in databases, and git is a bad database.
I like the traditional config management system approach to this. You can start by checking in your infra attributes in git (perhaps in an inventory file), but as you scale, you outgrow this approach and move to querying APIs: from your cloud provider or a config database.
As for secrets, a database is way better for management and security. And yeah, I know you can encrypt and check things into git, but that just moves the ball. Where do you store the encryption keys? You need a centralized solution.
If a git-style interface was a good database for this kind of data, we all would have switched years ago.
Technically, gitops "solves" all these problems, because if (big if here) someone has written a custom controller that does what you need it to do, you can check in a zillion lines of yaml to solve your problem.
But it's a lowest common denominator approach, and I've always seen a ton of scripting required against both the git repo and the deployed environment just to get to a baseline of visibility that I can get with Salt, Puppet, or Chef in a much more robust way.
GitOps systems I've used: ArgoCD and Flux.