How to manage environment variables, parameters and secrets for local environments, CI and deployed services?

What do people use to manage environment variables, parameters and secrets? I have a full stack app using terraform. So I’m dealing with:

  • Building a shadow-cljs project, injecting env vars for auth, backend, google api keys,
  • Running a backend service that needs api keys, database credentials
  • Managing CI which need access to parameters and secrets for builds and deployment
  • Managing terraform which requires input variables for my terraform configuration and also outputs that are passed into other services (for example frontend and backend)
  • Developing locally where I need access to those variables, parameters and secrets in some capacity

Right now I’ve hacked together a combination of:

  • Terraform passing vars, parameters and secrets into services such as the backend
  • Defining env vars into my CI using their environment variable store
  • Pulling env vars from terraform outputs when needed for building and deploying.

Ideally I’d like to manage all this centrally some how. What have people use in the past for consolidating all this?