Skip to content

Commit b7c0443

Browse files
committed
edits to getting started
1 parent 496aa01 commit b7c0443

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

README.rst

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,38 +34,33 @@ Requirements
3434
* Virtualenv (~15.0.0)
3535
* Virtualenvwrapper (~4.7.1)
3636

37-
Installation
38-
============
37+
Getting Started
38+
===============
3939

40-
Create a new folder for your project and create a virtualenv.
40+
Begin by creating a new virtualenv and project folder.
4141

4242
.. code:: bash
4343
44-
$ mkdir my_microservice
4544
$ mkvirtualenv my_microservice
45+
(my_microservice) $ mkdir my_microservice
4646
47-
Next Download using pip via pypi.
47+
Next, download *Python-Lambda* using pip via pypi.
4848

4949
.. code:: bash
5050
5151
(my_microservice) $ pip install python-lambda
5252
53-
Getting Started
54-
===============
55-
56-
The following will walk you through writing your first microservice with *Python-lambda*.
57-
5853
From your ``my_microservice`` directory, run the following to bootstrap your project.
5954

6055
.. code:: bash
6156
6257
(my_microservice) $ lambda init
6358
64-
If you look at the directory you will see four files were created: ``event.json``, ``__init__.py``, ``service.py``, and ``config.yaml``.
59+
This will create the following files: ``event.json``, ``__init__.py``, ``service.py``, and ``config.yaml``.
6560

66-
Let's begin by taking a look at ``config.yaml`` in your favorite text editor. For the purpose of this tutorial, the only thing required to be entered is ``aws_access_key_id`` and ``aws_secret_access_key``. You can find these by logging into the AWS management console.
61+
Let's begin by opening ``config.yaml`` in the text editor of your choice. For the purpose of this tutorial, the only required information is ``aws_access_key_id`` and ``aws_secret_access_key``. You can find these by logging into the AWS management console.
6762

68-
Next let's open ``service.py``, in it you'll find the following function:
63+
Next let's open ``service.py``, in here you'll find the following function:
6964

7065
.. code:: python
7166
@@ -77,28 +72,30 @@ Next let's open ``service.py``, in it you'll find the following function:
7772
return e + pi
7873
7974
80-
This is the hander function; this is what AWS Lambda will invoke in response to an event. You will notice that in the sample code provided ``e`` and ``pi`` are values looked up in a ``dict``. AWS Lambda uses the ``event`` parameter to pass in event data to the handler.
75+
This is the hander function; this is the function AWS Lambda will invoke in response to an event. You will notice that in the sample code ``e`` and ``pi`` are values in a ``dict``. AWS Lambda uses the ``event`` parameter to pass in event data to the handler.
8176

8277
So if for example your function is responding to an http request, ``event`` will be the ``POST`` JSON data and if your function returns something, the contents will be in your http response payload.
8378

84-
Now let's open the ``event.json`` file. Here you'll find the values of ``e`` and ``pi`` that are being referenced in the sample code.
79+
Next let's open the ``event.json`` file. Here you'll find the values of ``e`` and ``pi`` that are being referenced in the sample code.
8580

8681
If you now try and run:
8782

8883
.. code:: bash
8984
9085
(my_microservice) $ lambda invoke
9186
92-
"your test handler was successfully invoked!" should print out in your console. You've probably already put together that the ``lambda invoke`` command passes the values stored in the ``event.json`` file to your function.
87+
"your test handler was successfully invoked!" should print out in your console.
88+
89+
As you probably put together, the ``lambda invoke`` command grabs the values stored in the ``event.json`` file and passes them to your function.
9390

94-
The ``event.json`` file should help you develop your Lambda service locally.
91+
The ``event.json`` file should help you develop your Lambda service locally. You can specify an alternate ``event.json`` file by passing the ``--event=<filename>.json`` argument to ``lambda invoke``.
9592

96-
When you're ready to deploy your code to lambda simply run:
93+
When you're ready to deploy your code to Lambda simply run:
9794

9895
.. code:: bash
9996
10097
(my_microservice) $ lambda deploy
10198
102-
The deploy script will evaluate your virtualenv and identify your project dependencies (actually just pip freeze). It will package these up along with your handler function to a zip file that it then uploads to AWS Lambda.
99+
The deploy script will evaluate your virtualenv and identify your project dependencies. It will package these up along with your handler function to a zip file that it then uploads to AWS Lambda.
103100

104-
You can now log into the AWS Lambda management console to verify the code deployed successfully and wire it up to respond to an event.
101+
You can now log into the AWS Lambda management console to verify the code deployed successfully.

0 commit comments

Comments
 (0)