parameter-overrides on command line block samconfig.toml values
See original GitHub issueDescription:
I have most of my parameter_overrides defined in my samconfig.toml file for my local commands. However, I want to pass a single value via the command line --parameter-overrides value. The documentation states:
For the parameter_overrides entry, both the parameter values that you provide on the command line and entries in the configuration file take precedence over corresponding objects declared in the Parameters section of the template file.
This would indicate to me that you can provide both and they’ll be merged but this doesn’t appear to be happening.
Steps to reproduce:
samconfig.toml
version = 0.1
[default.local_invoke.parameters]
parameter_overrides = "myFuncBucket=\"dev-my-func\""
Make the following call:
sam local invoke MyFunc --parameter-overrides 'ParameterKey=myFuncQueue,ParameterValue=QueueValue'
Observed result:
The value of myFuncQueue is passed to the function but the value of myFuncBucket is not.
Expected result:
Both myFuncQueue and myFuncBucket should be available to the function.
or…
The documentation should be updated to reflect that passing a command line parameter-overrides will prevent the use of the parameter_overrides.
I can make that documentation update if that is the case. However, I’m hoping that this is a bug.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
$ cat /etc/issue
Ubuntu 20.04.1 LTS \n \l
$ sam --version
SAM CLI, version 1.7.0
$ go version
go version go1.15.4 linux/amd64
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:22 (5 by maintainers)
Top Related StackOverflow Question
I just came across this. It would be great to have
samcofig.tomlparameter_overrides merged with the cli values.In my samconfig.toml I used parameter_overrides to specify staging/prod environments:
This makes it super easy to do a deploy script by just passing
--config-envin ci. However I also pass in values to my stack that are generated at deploy time, so I pass these in via--parameter-overrides.For example:
Since
--parameter-overridesvia the cli overrides thesamconfig.toml, the settings defined there are basically useless and I have to type them over again.So what should happen should be a merge, with the command-line taking preference.
Please don’t close this issue. The referenced issue (#2176) does not resolve the underlying problem of not being able to consistently override individual paramters.