Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting lambda env variables does not work. #500

Closed
horenmar opened this issue Nov 30, 2016 · 6 comments
Closed

Setting lambda env variables does not work. #500

horenmar opened this issue Nov 30, 2016 · 6 comments

Comments

@horenmar
Copy link
Contributor

I am testing zappa for deployment of event-driven lambda functions (no APIGW component) and ran into trouble with env variables. According to documentation, zappa_settings.json like this

 {
    "dev": {
    ...
    "environment_variables": {"NICE": "To", "SEE" : "You"},
    ...
    }
}

should set two environment variables for the lambda, NICE and SEE. However, the lambda does not have these environment variables set, as verified by both print(os.environ) and looking at the lambda in AWS management console. Adding an environment variable manually works.

@Miserlou
Copy link
Owner

I don't know what you mean by "Lambda does not have these environment variables set."

Zappa environment variables have existed long before "Lambda environment variables", which I think were only added last week. They're not the same thing, and I don't know how the two interact. Can somebody confirm this? Maybe your AWS environment variables are overriding the Zappa ones, but I don't see how that's possible. I think this more likely due to there being no APIGW than AWS Env, but needs investigation.

@horenmar
Copy link
Contributor Author

I expected the environment_variables to be set as Lambda environment variables.

@Miserlou
Copy link
Owner

You mean the AWS ones?

@Miserlou
Copy link
Owner

If we do add support for those, it'll likely be done in a vendor prefixed way, ex aws_environment_variables

@Miserlou
Copy link
Owner

Cannot confirm yet, still investigating.

@Miserlou
Copy link
Owner

Confirmed it works with and without API Gateway, feel free to ask me to reopen if you can provide steps to reproduce.

Miserlou pushed a commit that referenced this issue Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants