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

Support for --parameter-values in sam local 0.3.0 #572

Closed
amirkav opened this issue Jul 23, 2018 · 7 comments
Closed

Support for --parameter-values in sam local 0.3.0 #572

amirkav opened this issue Jul 23, 2018 · 7 comments
Labels
stage/in-progress A fix is being worked on stage/waiting-for-release Fix has been merged to develop and is waiting for a release type/regression

Comments

@amirkav
Copy link

amirkav commented Jul 23, 2018

I read issues #400 and #456 and it looks like --parameter-values or --parameter-overrides are no longer supported for sam local invoke command. The ability to pass on parameters to a SAM Template when running locally is critical to test the behavior of the lambda function when deployed remotely.

Will --parameter-values or --parameter-overrides be supported for 'sam local invoke' command in future releases?

@luyun-aa
Copy link

+1 for this feature. It's really helpful in local testing.

@sanathkr sanathkr added stage/in-progress A fix is being worked on type/regression stage/waiting-for-release Fix has been merged to develop and is waiting for a release labels Sep 7, 2018
@jfuss
Copy link
Contributor

jfuss commented Oct 24, 2018

Closing. Was released with 0.6.1

@jfuss jfuss closed this as completed Oct 24, 2018
@medinarrior
Copy link
Contributor

SAM CLI --parameter-overrides doesn't use the same format as AWS CLI

$ aws cloudformation deploy help

       --parameter-overrides  (list) A list of parameter structures that spec-
       ify input parameters for your stack  template.  If  you're  updating  a
       stack  and  you don't specify a parameter, the command uses the stack's
       existing value. For new stacks, you must specify parameters that  don't
       have  a  default  value.  Syntax: ParameterKey1=ParameterValue1 Parame-
       terKey2=ParameterValue2 ...

       Syntax:

          "string" "string" ...

$ sam local start-api --help

       --parameter-overrides      Optional. A string that contains
                                  CloudFormation parameter overrides encoded
                                  as key=value pairs. Use the same format as
                                  the AWS CLI, e.g. 'ParameterKey=KeyPairName,
                                  ParameterValue=MyKey ParameterKey=InstanceTy
                                  pe,ParameterValue=t1.micro'

Users gets the following error while using aws cloudformation deploy format:

Error: Invalid value for "--parameter-overrides": ParameterKey1=ParameterValue1 is not in valid format. It must look something like 'ParameterKey=KeyPairName,ParameterValue=MyKey ParameterKey=InstanceType,ParameterValue=t1.micro'

@guijob
Copy link

guijob commented Feb 6, 2019

Using sam local start-api --parameter-overrides Environment=dev throws:

Error: Invalid value for "--parameter-overrides": Environment=dev is not in valid format. It must look something like 'ParameterKey=KeyPairName,ParameterValue=MyKey ParameterKey=InstanceType,ParameterValue=t1.micro'

@jfuss
Copy link
Contributor

jfuss commented Feb 6, 2019

@guijob The way you are specifying them are incorrect.

sam local start-api --parameter-overrides ParameterKey=Environment,ParameterValue=dev

@pmayet
Copy link

pmayet commented Feb 22, 2019

@jfuss How override multi parameters ?

@martijnvankempen
Copy link

@pmayet You can override multiple parameters by using quotes.

Example:
--parameter-overrides "ParameterKey=Key1,ParameterValue=value1 ParameterKey=Key2,ParameterValue=value2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/in-progress A fix is being worked on stage/waiting-for-release Fix has been merged to develop and is waiting for a release type/regression
Projects
None yet
Development

No branches or pull requests

8 participants