AWS Lambda and DotEnv

As explained a few times we are working with Lambda on a project lately. One of the things I learned is, that DotEnv doesn’t work with Lambda, at least not out of the box. And because one does provide the configuration via “real” environment variables normally anyway, there is no need to use DotEnv.

In my case, that means I added DotEnv for local development, but via composer req --dev, so it is added to require-dev in the composer.json and therefore not deployed to the production system.

Leave a Reply