Menu
AWS Greengrass
Developer Guide

Configure Long-Lived Lambda Functions for AWS Greengrass

You are now ready to configure your Lambda function for AWS Greengrass. In the AWS IoT console, go to Greengrass and choose Groups. Choose the group you created in Module 2. On the GREENGRASS GROUP page, choose Lambdas. Choose Add Lambda, Use existing Lambda, select Greengrass_HelloWorld_Counter, and choose Next:


                    Screenshot with Greengrass_HelloWorld_Counter and the Next button
                        highlighted.

For the version, choose Alias: GG_HW_Counter and then choose Finish. On the GREENGRASS GROUP page, under Lambdas, for the Greengrass_HelloWorld_Counter Lambda function, choose Edit Configuration.:


                    Screenshot of the Group Configuration page with Lambdas in the left nav
                        and Edit Configuration highlighted.

On the configuration page, change Timeout to 25 seconds in that the Lambda function sleeps for 20 seconds before each invocation. Under Lambda lifecycle, select Make this function long-lived and keep it running indefinitely, then choose Update.


                    Screenshot with the Timeout field set to 25 seconds and the Make this
                        function long-lived and keep it running indefinitely radio button
                        selected.