Skip to content

feat(init): load .env file at startup of sam local #1355

@rynop

Description

@rynop

Describe your idea/feature/enhancement

It would be great if sam local loaded env vars from a .env file instead of a non-standard --env-vars JSON file.

Proposal

Create an option --use-dotenv that will tell the docker container to load env vars from a .env file prior to launching the lambda. Vars defined in .env will apply to ALL lambda functions defined in the sam template.yml

This will eliminate the need to dual maintenance a .env and a sam-env.json file. A .env file is needed for local dev that does not need to run through a lambda simulator (for more rapid development iterations).

--env-vars is still useful for variables that are specific to an individual lambda.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions