Skip to content

Invoke Function Without Parameters (skip STDIN) #556

Closed

Description

@mntlty

Description:

It does not seem that there is a way to invoke a function without passing in some kind of event, even if the lambda Handler takes no arguments, as the lack of params defaults to waiting for input from STDIN. No arg handler functions are valid, at least in Golang (haven't looked at other programming languages)

https://docs.aws.amazon.com/lambda/latest/dg/go-programming-model-handler-types.html

Steps to reproduce the issue:

  1. invoke function normally sam local invoke MyFunc

Observed result:

  1. With no event, function execution waits for input from stdin
  2. With a dummy event e.g. echo '{}' | sam local invoke MyFunc, function executes immediately despite not taking any argument params func handler() error

Expected result:
Possibly pass a command line flag like --no-args so that the lambda executes immediately rather than waiting for STDIN

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
OS X 10.13.5 High Sierra

Output of sam --version:
SAM CLI, version 0.3.0

Activity

  1. tebruno99 commented on Jul 18, 2018

    @tebruno99

    This actually would be super useful when developing against SQS.

  2. added
    contributors/good-first-issue
    on Jul 31, 2018
  3. akkaash commented on Aug 3, 2018

    @akkaash
    Contributor

    Looking into this.

  4. added
    stage/waiting-for-release
    and removed on Aug 8, 2018
  5. jfuss commented on Aug 29, 2018

    @jfuss
    Contributor

    Closing this as it was released in 0.6.0

  6. removed
    stage/waiting-for-release
    on Aug 29, 2018
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

    area/lambda-invokecontributors/good-first-issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions