|
1 |
| -# lambda-uploader |
| 1 | +lambda-uploader |
| 2 | +=============== |
2 | 3 |
|
3 |
| -Provides a quick command line utility for packaging and publishing Python AWS Lambda |
4 |
| -functions. This is a work in progress and pull requests are always welcome. |
| 4 | +Provides a quick command line utility for packaging and publishing |
| 5 | +Python AWS Lambda functions. This is a work in progress and pull |
| 6 | +requests are always welcome. |
| 7 | + |
| 8 | +Installation |
| 9 | +~~~~~~~~~~~~ |
5 | 10 |
|
6 |
| -### Installation |
7 | 11 | The latest release of lambda-uploader can be installed via pip:
|
8 |
| -``` |
9 |
| -pip install lambda-uploader |
10 |
| -``` |
11 |
| -An alternative install method would be manually installing it leveraging `setup.py`: |
12 |
| -``` |
13 |
| -git clone https://github.com/rackerlabs/lambda-uploader |
14 |
| -cd lambda-uploader |
15 |
| -python setup.py install |
16 |
| -``` |
17 |
| - |
18 |
| -### Configuration File |
19 |
| -The lambda uploader expects a directory with, at a minimum, your lambda function |
20 |
| -and a lambda.json file. It is not necessary to set requirements in your config |
21 |
| -file since the lambda uploader will also check for and use a requirements.txt file. |
| 12 | + |
| 13 | +:: |
| 14 | + |
| 15 | + pip install lambda-uploader |
| 16 | + |
| 17 | +An alternative install method would be manually installing it leveraging |
| 18 | +``setup.py``: |
| 19 | + |
| 20 | +:: |
| 21 | + |
| 22 | + git clone https://github.com/rackerlabs/lambda-uploader |
| 23 | + cd lambda-uploader |
| 24 | + python setup.py install |
| 25 | + |
| 26 | +Configuration File |
| 27 | +~~~~~~~~~~~~~~~~~~ |
| 28 | + |
| 29 | +The lambda uploader expects a directory with, at a minimum, your lambda |
| 30 | +function and a lambda.json file. It is not necessary to set requirements |
| 31 | +in your config file since the lambda uploader will also check for and |
| 32 | +use a requirements.txt file. |
22 | 33 |
|
23 | 34 | Example lambda.json file:
|
24 |
| -```json |
25 |
| -{ |
26 |
| - "name": "myFunction", |
27 |
| - "description": "It does things", |
28 |
| - "region": "us-east-1", |
29 |
| - "handler": "function.lambda_handler", |
30 |
| - "role": "arn:aws:iam::00000000000:role/lambda_basic_execution", |
31 |
| - "requirements": ["pygithub"], |
32 |
| - "timeout": 30, |
33 |
| - "memory": 512 |
34 |
| -} |
35 |
| -``` |
36 |
| - |
37 |
| -### Command Line Usage |
38 |
| -To package and upload simply |
39 |
| -```shell |
40 |
| -lambda-uploader ./myfunc |
41 |
| -``` |
42 |
| - |
43 |
| -If you would prefer to upload another way you can tell the uploader to ignore that step. |
44 |
| -```shell |
45 |
| -lambda-uploader --no-upload ./myfunc |
46 |
| -``` |
| 35 | + |
| 36 | +.. code:: json |
| 37 | +
|
| 38 | + { |
| 39 | + "name": "myFunction", |
| 40 | + "description": "It does things", |
| 41 | + "region": "us-east-1", |
| 42 | + "handler": "function.lambda_handler", |
| 43 | + "role": "arn:aws:iam::00000000000:role/lambda_basic_execution", |
| 44 | + "requirements": ["pygithub"], |
| 45 | + "timeout": 30, |
| 46 | + "memory": 512 |
| 47 | + } |
| 48 | +
|
| 49 | +Command Line Usage |
| 50 | +~~~~~~~~~~~~~~~~~~ |
| 51 | + |
| 52 | +To package and upload simply run the command from within your lambda |
| 53 | +directory or with the directory as an option. |
| 54 | + |
| 55 | +.. code:: shell |
| 56 | +
|
| 57 | + lambda-uploader ./myfunc |
| 58 | +
|
| 59 | +If you would prefer to upload another way you can tell the uploader to |
| 60 | +ignore the upload. This will create a package and leave it in the |
| 61 | +project directory. |
| 62 | + |
| 63 | +.. code:: shell |
| 64 | +
|
| 65 | + lambda-uploader --no-upload ./myfunc |
0 commit comments