Skip to content

Commit e8666e2

Browse files
committed
Document running lambdas locally vs. testing them in a containerized lambda environment
1 parent 899db2a commit e8666e2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,25 @@ If you need to run any initialization code, you can do before returning the lamb
3838

3939
Development
4040
-----------
41-
To test your lambda locally, run the following:
41+
To run your lambda locally, use the following:
42+
43+
```bash
44+
$ xp lambda run Greet '{"name":"Timm"}'
45+
Hello Timm from PHP 8.2.7 via Greet @ test-local-1
46+
```
47+
48+
*This does not provide a complete lambda environment, and does not have any execution limits imposed on it!*
49+
50+
Integration testing
51+
-------------------
52+
To test your lambda inside a local containerized lambda environment, use the *test* command.
4253

4354
```bash
4455
$ xp lambda test Greet '{"name":"Timm"}'
4556
START RequestId: 9ff45cda-df9b-1b8c-c21b-5fe27c8f2d24 Version: $LATEST
4657
END RequestId: 9ff45cda-df9b-1b8c-c21b-5fe27c8f2d24
4758
REPORT RequestId: 9ff45cda-df9b-1b8c-c21b-5fe27c8f2d24 Init Duration: 922.19 ms...
48-
"Hello Timm from PHP 8.0.10 via test @ us-east-1"
59+
"Hello Timm from PHP 8.2.7 via test @ us-east-1"
4960
```
5061

5162
*This functionality is provided by the [AWS Lambda base images for custom runtimes](https://gallery.ecr.aws/lambda/provided)*

0 commit comments

Comments
 (0)