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

Environment Vars from Template Incorrectly Display In Run Config #2509

Closed
AMcManigal opened this issue Mar 18, 2021 · 1 comment
Closed

Environment Vars from Template Incorrectly Display In Run Config #2509

AMcManigal opened this issue Mar 18, 2021 · 1 comment
Labels
bug We can reproduce the issue and confirmed it is a bug.

Comments

@AMcManigal
Copy link

AMcManigal commented Mar 18, 2021

Describe the bug
Environment variables in the Run/Debug configuration are overwritten with the SAM template variables upon saving and closing the window for configurations loaded from the template. However the values are actually saved in the run config. They just aren't loaded correctly.

To reproduce

  1. Set up a run configuration for locally running a Lambda and load the configuration from a SAM template. Ensure that the function has an environment variable defined in the template.
  2. Overwrite an environment variable value that was loaded from the template with a new value.
  3. Click OK to save the configuration and close the window.
  4. Go back into the run configuration screen. The old value from the template will have replaced itself.

Expected behavior
I expected the IDE to save the override values I entered so that template environment values could be overridden. However, since it does not I have no choice but to hardcode the variables directly into the template.

Screenshots

  1. The function defined in the template.
    Template Configuration
  2. The generated run configuration.
    Original Run Config
  3. The variable is set to 120
    Setting the variable to a different value
  4. After clicking OK and returning to the run config the original value has been restored.
    After clicking OK and going back into the run configuration
  5. Code
    Screen Shot 2021-03-18 at 1 30 50 PM
  6. However when the code runs it uses the saved value.
    Screen Shot 2021-03-18 at 1 30 58 PM

Your Environment

  • OS: Catalina 10.15.7
  • JetBrains product: PyCharm
  • JetBrains product version: PyCharm 2020.3.3
  • AWS Toolkit version: 1.25-203
  • SAM CLI version: 1.19.1
  • JVM/Python version:java 11.0.4 2019-07-16 LTS/Python 3.8.8
@AMcManigal AMcManigal added the bug We can reproduce the issue and confirmed it is a bug. label Mar 18, 2021
@AMcManigal AMcManigal changed the title Environment Vars from Template Can't Be Overridden in Run Config Environment Vars from Template Incorrectly Display In Run Config Mar 18, 2021
@abrooksv
Copy link
Contributor

Thanks for the bug report, I see the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants