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

Add Environment Variables with 'From template' option #2282

Closed
AMcManigal opened this issue Dec 11, 2020 · 3 comments
Closed

Add Environment Variables with 'From template' option #2282

AMcManigal opened this issue Dec 11, 2020 · 3 comments
Labels
feature-request New feature or enhancement. May require GitHub community feedback.

Comments

@AMcManigal
Copy link

Your Environment

  • OS: macOS Catalina
  • JetBrains product: PyCharm
  • JetBrains product version: 2020.3
  • AWS Toolkit version:1.22-203
  • SAM CLI version: 1.62
  • JVM/Python version: 3.8.6

Question

I recently upgraded to the latest version of AWS Toolkit. Now when I use the 'From template' option in the 'Run/Debug Configurations' screen I can't see an option to add environment variables. It does appear if I use 'From handler' instead but then I lose the ability to run a function with layers.

Is there a way to add environment variables with the 'From template' option? This could be done in AWS Toolkit version 1.16-193.

Thanks.

@AMcManigal AMcManigal added the guidance General information and guidance, answers to FAQs, or recommended best practices/resources. label Dec 11, 2020
@rdt712
Copy link

rdt712 commented Dec 14, 2020

You can do it in the run config by going to the SAM CLI tab and adding the --env-vars or -n flags and the absolute path to your env.json file in the local invoke args section.

@abrooksv
Copy link
Contributor

Sorry for the inconvenience, it was removed as we re-did the UI and it was deemed confusing given the current UX and the actual limitations of SAM:

In handler mode, you could add any env vars you wanted, but in template mode, only env vars defined in the template would actually be overridden and that was not explained to the user leading to confusion.

We can look into fixing that UI to reveal that limitation. @rdt712 is correct on the current work around.

@abrooksv abrooksv added feature-request New feature or enhancement. May require GitHub community feedback. and removed guidance General information and guidance, answers to FAQs, or recommended best practices/resources. labels Dec 14, 2020
@kiiadi
Copy link
Contributor

kiiadi commented Dec 15, 2020

I also think what might be useful is an "import from remote lambda" feature for both template and handler modes - this would allow us to point at a remote Lambda function and automatically import the environment variables from it. Handy when you have environment variables that are populated by refs' in cfn/cdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or enhancement. May require GitHub community feedback.
Projects
None yet
Development

No branches or pull requests

4 participants