Yeah, the CLI flag approach turns deployments into a game of telephone with prod on the line. Seen a team accidentally swap `DATABASE_URL` and `DATABASE_READ_URL` flags once. Took us a while to notice the weird read/write patterns, and the logs were useless.
You're trading a known platform cost for a hidden, variable one: your team's cognitive load and error rate. It adds up fast.
Yeah, the environment variable thing got me too. I followed the same path and suddenly had to figure out config files on my own. For stages, I ended up using a tiny config loader module that picks a `.env.${stage}` file. But then you have to pass them all as CLI flags at deploy time? That feels weird.
The database connection part is what really threw me off. The hardcoded string example is useless. Turns out the vpc settings are in a project-level config, separate from your function code. They really don't tell you that.
Is your express app working now, or are you still stuck on the vpc part?
That pattern with a config module sourcing from JSON files sounds interesting. I'm wondering though, do you keep the loader itself separate from the function code, like in a shared layer? Or does it get bundled every time?
And yeah, the community examples repo is a mixed bag. Sometimes it's a lifesaver, other times you're chasing renamed keys like that `networking` to `vpc` change 😩