AWS Greengrass
Developer Guide

Create and Package the Lambda Function

  1. On you computer (not the AWS Greengrass device), open a web browser, navigate to the GitHub repository, choose Raw, press Ctrl + S (or Command + S for the Mac) and save the Lambda file to the folder containing the three SDK folders greengrasssdk, greengrass_common, and greengrass_ipc_python_sdk.


    For UNIX-like systems, you can run the following Terminal command to download the file:

    sudo wget

    Next, package the Lambda file with the three SDK folders into a .zip file, as described in Module 3 (Part 1). Name the package, as indicated below.

                            Screenshot showing zipped contents of
  2. Upload your Lambda function package into the AWS Lambda console. Name your function Greengrass_HelloWorld_Counter with the default role you created in Module 3 (Part 1). For Handler, type greengrassHelloWorldCounter.function_handler.

                            Function code screenshot with Code entry type set to Upload a
                                .ZIP file, Runtime set to Python 2.7, Handler set to
                                greengrassHelloWorldCounter.function_handler, and Function package
                                set to

    Choose Save.

    Under Actions, choose Publish new version and describe it as First version, then choose Publish.

    Under Actions, choose Create alias for version 1 and name it GG_HW_Counter, then choose Create:

                            Create a new alias screenshot with the Name field set to
                                GG_HW_Counter, the Version field set to 1, and the Create button

    Recall that aliases create a single entity for your Lambda function that AWS Greengrass devices can subscribe to without having to update subscriptions with Lambda version numbers every time the function is modified.