Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Enhancement: Environment Variables #26

Closed

Description

@jpotts18

What do you think about adding an .env file into every lambda folder? Sending environment variables can be accomplished after uploading the zip file.

# http://docs.aws.amazon.com/lambda/latest/dg/env_variables.html
aws lambda create-function \
    --region us-east-1
    --function-name myTestFunction
    --zip-file fileb://path/package.zip
    --role role-arn
    --environment Variables={LD_LIBRARY_PATH=/usr/bin/test/lib64}
    --handler index.handler
    --runtime nodejs4.3
    --profile default

Activity

  1. jmeekhof commented on Jun 3, 2017

    @jmeekhof
    Collaborator

    This would be a great feature to add. Definitely on the roadmap.

  2. jmeekhof commented on Jun 6, 2017

    @jmeekhof
    Collaborator

    Taking a peak through the code, I think the support is there to translate some local env variables to the lambda instance.

    Take a look at this code:

    Environment={
    'Variables': {
    key.strip('LAMBDA_'): value
    for key, value in os.environ.items()
    if key.startswith('LAMBDA_')
    }
    },

    If you name a local variable LAMBDA_foo, it should translate to foo in the lambda instance.

    That being said, I like the idea of a singular file that handles the variables instead of this method.

    Also, I'm unsure of what how these variables are handled upon updates to a function (opposed to the creation of a new function).

  3. jmeekhof commented on Jun 7, 2017

    @jmeekhof
    Collaborator

    See issue #11

  4. added 3 commits that reference this issue on Jun 7, 2017
  5. added 2 commits that reference this issue on Jun 16, 2017
  6. jmeekhof commented on Jun 16, 2017

    @jmeekhof
    Collaborator

    This feature has been added and merged to master. It'll be generally available next release. Meanwhile, you can grab it off the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions