已创建无参数AWS Lambda函数,如何通过浏览器按钮调用?
Hey there! I get why you're looking for a "Run" or "Invoke" button—AWS Lambda uses the Test button for this exact purpose, even for functions that don't take any parameters. Here's the step-by-step to get your 2*2 calculation to return 4 right in the browser:
- On your Lambda function's main page in the AWS Console, look for the orange Test button in the top-right area (it’s next to the "Deploy" button).
- Click it, and you’ll be asked to set up a test event. Since your function doesn’t use parameters, you can just use the default setup:
- Give your test event a simple name (like "BasicTest")
- Leave the default JSON payload as-is (your function will ignore it completely—no need to edit anything here)
- Hit the "Create" button to save this test event.
- Now just click the Test button again. Lambda will invoke your function immediately, and you’ll see the full execution results (including your expected return value of 4) in the "Execution result" panel that pops up below the code editor.
Once you’ve created that test event, you can reuse it anytime by clicking Test again—no need to set it up from scratch each time.
内容的提问来源于stack exchange,提问作者stevec
相关产品推荐
相关产品推荐

