I have database credentials stored as environment variables for a lambda functions server.
If I run netlify prod I get a temporary URL that my client can connect to and database transactions work. However, if I use the --alias option, those credentials are not picked up.
The vars are all set up for Deploy Previews; is there something special about aliased previews I need to know about?
I’m assuming you mean you’re running netlify deploy --build? There’s no netlify prod that I’m aware of. Have you tried setting the variables for branch deploys when using the alias flag?
I just tried setting the variables for branch deploy and it works. I don’t understand why that is necessary for alias prefixes but not for auto-generated hash prefixes.
I’m aware what the docs say, I was simply asking you to try. Since it’s working, there’s some kind of a bug at play, which I’ll file for the devs. However, I won’t expect any activity on it any time soon as it’s a low priority issue.