Skip to content

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

Closed

Description

@amirkav

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?

Activity

  1. luyun-aa commented on Aug 17, 2018

    @luyun-aa

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

  2. added
    stage/in-progress
    stage/waiting-for-release
    on Sep 7, 2018
  3. jfuss commented on Oct 24, 2018

    @jfuss
    Contributor

    Closing. Was released with 0.6.1

  4. medinarrior commented on Nov 7, 2018

    @medinarrior
    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'

  5. guijob commented on Feb 6, 2019

    @guijob

    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'
    
  6. jfuss commented on Feb 6, 2019

    @jfuss
    Contributor

    @guijob The way you are specifying them are incorrect.

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

  7. pmayet commented on Feb 22, 2019

    @pmayet

    @jfuss How override multi parameters ?

  8. martijnvankempen commented on Jul 18, 2019

    @martijnvankempen

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/in-progressstage/waiting-for-releasetype/regression

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions