Skip to content

Commit dc7f071

Browse files
committed
Add installation instructions
1 parent 567f936 commit dc7f071

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,39 @@ aws iam get-role \
5757

5858
### Install the `echo` function
5959

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+
6069
```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
6285
```
6386

6487
## Usage
6588

89+
Invoke using `aws lambda invoke`:
90+
6691
```bash
92+
# Invoke the function and save the output to output.txt
6793
aws lambda invoke --function-name echo --payload '["hello", "world"]' output.txt
6894
```
6995

0 commit comments

Comments
 (0)