5

I know I can invoke lambdas with sam local and also the command line.

But sometimes it's convenient to test the lambda by invoking it through the UI by configuring a test event there.

Is it possible to include sample/test event in the sam template so when it's deployed the test event is populated in the UI for me? So I can keep that test event updated and just have to press the test button if I'm working with it through the UI?

halfer
  • 19,824
  • 17
  • 99
  • 186
red888
  • 27,709
  • 55
  • 204
  • 392
  • 3
    The test event options in lambda console are specific to console only. There is no api to populate or mange them unfortunately. – Marcin May 13 '20 at 00:16

1 Answers1

0

Others are wanting the same thing , but when the same question was asked in a github issue on the SAM repo in 2018, Configuring test events through SAM template, AWS engineers said it's not in scope for SAM.

FWIW the answer suggested CodePipeline as a possible way to do something similar, programmatically:

I think this is out of scope of what SAM can do. SAM can't set up a console test event, like Brett mentioned, but something similar to this could be set up in a CodePipeline workflow. For more information about CodePipeline, see the docs:
https://docs.aws.amazon.com/lambda/latest/dg/build-pipeline.html

Daryn
  • 4,791
  • 4
  • 39
  • 52