File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,39 @@ aws iam get-role \
57
57
58
58
### Install the ` echo ` function
59
59
60
+ Generate a ` .zip ` of the source code in ` package.zip ` :
61
+
62
+ ``` bash
63
+ # Generate package.zip
64
+ zip package echo.py
65
+ ```
66
+
67
+ Copy ` package.zip ` to an S3 bucket that you own:
68
+
60
69
``` bash
61
- # TBD
70
+ # Copy package.zip to your S3 bucket
71
+ aws s3 cp package.zip s3://${YOUR_AWS_S3_BUCKET} /lambda/
72
+ ```
73
+
74
+ Finally, create the function, remember to specify the ` Arn ` of your ` lambda-default ` role:
75
+
76
+ ``` bash
77
+ # Create your function
78
+ aws lambda create-function \
79
+ --publish \
80
+ --runtime python2.7 \
81
+ --role ${YOUR_ARN_LAMBDA_DEFAULT_ROLE} \
82
+ --handler echo.handler \
83
+ --function-name echo \
84
+ --code S3Bucket=${YOUR_AWS_S3_BUCKET} ,S3Key=lambda/package.zip
62
85
```
63
86
64
87
## Usage
65
88
89
+ Invoke using ` aws lambda invoke ` :
90
+
66
91
``` bash
92
+ # Invoke the function and save the output to output.txt
67
93
aws lambda invoke --function-name echo --payload ' ["hello", "world"]' output.txt
68
94
```
69
95
You can’t perform that action at this time.
0 commit comments