Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Deploy from CLI does not update environment variables #799

Closed
richardkall opened this issue Oct 13, 2017 · 4 comments
Closed

Deploy from CLI does not update environment variables #799

richardkall opened this issue Oct 13, 2017 · 4 comments

Comments

@richardkall
Copy link
Contributor

What is the current behavior?

graphcool deploy does not seem to update environment variables correctly. Does not matter if they are defined just as strings or as ${env:NAME} in graphcool.yml.

How to reproduce:

  1. Clone this Graphcool example and deploy it according to instructions:
    https://github.com/graphcool/graphcool/tree/master/examples/env-variables-in-functions

  2. Run the query without a parameter and you should see "Hello Alice".

  3. Update NAME in the graphcool.yml file to another string. Re-deploy. The CLI found a diff an deploys.

  4. When running the query, "Alice" is still the name, it has not changed.

  5. Try changing the string again. A bit unclear what's happening here. I was able to deploy once more, but then process.env.NAME seems to be undefined and the query returns "Hello World". I was not able to deploy again after that, even though I'm changing the environment variable no diff is detected.

What is the expected behavior?

graphcool deploy should detect changes in functions.hello.handler.code.environment and update them in the environment.

CLI version

graphcool/0.7.0-beta.12 (darwin-x64) node-v8.5.0

@timsuchanek
Copy link
Contributor

Thanks for reporting @richardkall !
This is fixed in the latest alpha graphcool@0.8.0-alpha.8

@maxdarque
Copy link

maxdarque commented Dec 26, 2017

I think I'm still getting this error on graphcool/0.10.1 (darwin-x64) node-v8.6.0 and I can't seem to update my AWS credentials which is kind of critical.

I had difficulty with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. As a work around I changed the environmental variables to AWS_ACCESS_KEY_ID_X and AWS_SECRET_ACCESS_KEY_X.

@marktani
Copy link
Contributor

As functions are deployed to AWS Lambda, there are certain environment variables that are 'protected', as AWS Lambda writes them. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are two examples.

@maxdarque
Copy link

@marktani thanks Nilan. Is there a list of protected environment variables?

Also who's AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY am I seeing when I do a console.log()?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants