Bug: SAM deploy only sets env vars once
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Description:
When using env vars in the template file, the values will only be used once and will never update when the values are changes in the template.
They will **only** change when the name of the ref is changed.
Furthermore, the values seem somehow pulled from a "cache", because when we change the Refs back to their original names, the value that gets deployed is an old one we no longer use.
### Steps to reproduce:
1. Sam deploy with a template file and a new env var from a ref.
2. Change the ref's **value**
3. Deploy
4. Confirm value has _not_ updated
5. Change the ref's **name** and value
6. Deploy
7. Confirm value _has_ updated
### Observed result:
I can't provide everything for obvious security reasons, but the debugger **does** pick up the right value:
`2022-07-11 11:40:09,407 | Collected default values for parameters: {'TheGraphProjectSlug': 'remx-subgraph2'}`
Result in Lambda (incorrect):

### Expected result:
Env vars to just update their values correctly.
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
1. OS: MacOS 12.3.1
2. `sam --version`: 1.53.0
8. AWS region: us-east-1
`Add --debug flag to command you are running`
Contributor guide
Assessment
This issue has not been assessed yet.