@@ -8,7 +8,7 @@ The basics of using [SAM Cli][1] for AWS Lambda PHP applications.
8
8
3 . Select one under the options
9
9
1 . Create php binary by following steps in [ ` doc/create_php_binary.md ` ] [ 4 ]
10
10
2 . Use prebuilt [ Php 7.3.1] [ 5 ]
11
- 3 . Just put the yml this projects ARN ` arn:aws:lambda:eu-central-1:303814004728:layer:aws-lambda-layer-php-7-3-1:3 `
11
+ 3 . Just put the yml this projects ARN ` arn:aws:lambda:eu-central-1:303814004728:layer:aws-lambda-layer-php-7-3-1:6 `
12
12
4 . Write your serverless application (!) - the default is in ` src/handlers/hello.php `
13
13
5 . Run ` ./deploy.sh ` to deploy to Lambda
14
14
@@ -28,8 +28,26 @@ Hello world looks like:
28
28
}
29
29
30
30
## Local Tests
31
- Run ` echo "hi" | sam local invoke "HelloPhp73" `
32
- Result: ` {"msg":"hello from PHP 7.3.1","eventData":"hi\n","data":null} `
31
+ #### Input stream as event
32
+ Run:
33
+ ` echo "hi" | sam local invoke HelloPhp73 `
34
+ Result:
35
+ ` {"msg":"hello from PHP 7.3.1","eventData":"hi\n","data":null} `
36
+ #### File stream as event
37
+ Run:
38
+ ` sam local invoke HelloPhp73 --event=events/hello.sampledata.json `
39
+ Result:
40
+ ```
41
+ {
42
+ "msg": "hello from PHP 7.3.1",
43
+ "eventData": "{\n \"id\": \"ulbimesm12ym12kmzkzfgkzkuzeyfg\",\n \"name\": \"Lambda\",\n \"icon\": \"\u03bb\"\n}",
44
+ "data": {
45
+ "id": "ulbimesm12ym12kmzkzfgkzkuzeyfg",
46
+ "name": "Lambda",
47
+ "icon": "\u03bb"
48
+ }
49
+ }
50
+ ```
33
51
34
52
35
53
[ 1 ] : https://github.com/awslabs/aws-sam-cli
0 commit comments