> For the complete documentation index, see [llms.txt](https://eric-lo.gitbook.io/lab-serverless-function/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eric-lo.gitbook.io/lab-serverless-function/deploy-and-test-your-restapi.md).

# Deploy and test your Function

First, click **Test** button on the left of **Deploy**.

![](/files/pGoiSALIh5PrluPSzRwf)

Select **Create new test event**. For Event template, choose **hello-world**. Give a name to your test and write your test case in json format, like the following figure. Then click **Create** to create your test.

![](/files/NvH2sS4cLuzRPM5VNjRd)

Then click Test again, you will get a file called Execution result, showing the result of your test.

![](/files/4GI3czTWXMlbLzgK1ibM)

We can also invoke our deployed lambda function through aws cli. Go to the shell we opened before entering into the AWS Console, paste the following command, you will successfully invoke your sum function and get the result.

```
# The function return will be saved in response.json.
aws lambda invoke --cli-binary-format raw-in-base64-out --function-name sum --payload '{ "a": 2, "b": 3}' response.json && less response.json
```

![](/files/RotCOfHsVSov1fLhvg9n)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eric-lo.gitbook.io/lab-serverless-function/deploy-and-test-your-restapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
