Using Amazon Lambda with an Amazon Snowball Edge - AmazonSnowball Edge Developer Guide
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Using Amazon Lambda with an Amazon Snowball Edge

Following, you can find an overview of Amazon Lambda powered by Amazon IoT Greengrass as used in an Amazon Snowball Edge device. With this feature, you can run Lambda functions locally on a Snowball Edge. To use Lambda powered by Amazon IoT Greengrass functions with Snowball Edge, you must create your jobs in an Amazon Web Services Region supported by Amazon IoT Greengrass. For a list of valid Amazon Web Services Regions, see Amazon IoT Greengrass in the Amazon General Reference.

If you created your job before July 17, 2018, this information doesn't apply to your device. Instead, see Using Amazon Lambda with an Amazon Snowball Edge.

Note

These features are only supported in the following Amazon Web Services Regions:

  • Asia Pacific (Tokyo)

  • Asia Pacific (Sydney)

  • Canada (Central)

  • US East (N. Virginia)

  • US West (Oregon)

Before You Start

Before you create a Python-language Lambda function to run on your Snowball Edge, we recommend that you familiarize yourself with the following services, concepts, and related topics.

Prerequisites for Amazon IoT Greengrass

Amazon IoT Greengrass is software that extends Amazon Web Services Cloud capabilities to local devices. Amazon IoT Greengrass makes it possible for local devices to collect and analyze data closer to the source of information, while also securely communicating with each other on local networks. More specifically, developers who use Amazon IoT Greengrass can author serverless code (Lambda functions) in the Amazon Web Services Cloud. They can then conveniently deploy this code to devices for local execution of applications.

The following Amazon IoT Greengrass concepts are important to understand when using Amazon IoT Greengrass with a Snowball Edge:

  • Amazon IoT Greengrass requirements – For a full list of Amazon IoT Greengrass requirements, see Requirements in the Amazon IoT Greengrass Developer Guide. Amazon IoT Greengrass supports Python version 2.7, and each Lambda function has a minimum RAM requirement of 128 MB.

  • Amazon IoT Greengrass core – Each Snowball Edge has the Amazon IoT Greengrass core software. For more information about the Amazon IoT Greengrass core software, see Greengrass Core Software in the Amazon IoT Greengrass Developer Guide.

  • Amazon IoT Greengrass group – A Snowball Edge is part of an Amazon IoT Greengrass group as the group's core device. For more information about groups, see Amazon Greengrass IoT Groups in the Amazon IoT Greengrass Developer Guide.

  • MQTT – Amazon IoT Greengrass uses the industry-standard, lightweight Message Queue Telemetry Transport (MQTT) protocol to communicate within a group. Within a Snowball Edge, there is an IoT device associated with the Amazon S3 interface. When data is written using Amazon S3 PUT object operations on buckets specified at job creation, these operations trigger MQTT messages. These messages in turn trigger any associated Lambda functions. In addition, any MQTT-compatible device or software in your Amazon IoT Greengrass group can trigger the Lambda functions, if you define the related MQTT message to do so.

  • Associated service role – Before you can use Amazon IoT Greengrass with a Snowball Edge as a core device, you must associate an Amazon IoT Greengrass service role with your account. This association allows Amazon IoT Greengrass to access your Lambda functions and Amazon IoT resources. For more information, see Associating an Amazon IoT Greengrass Service Role with Your Account.

Prerequisites for Amazon Lambda

Amazon Lambda is a compute service that lets you run code without provisioning or managing servers. The following Lambda concepts are important to understand when using Lambda with a Snowball Edge:

  • Lambda functions – Your custom code, uploaded and published to Lambda and used on a Snowball Edge. For more information, see Lambda Functions in the Amazon Lambda Developer Guide.

  • Lambda console – The console in which you upload, update, and publish your Python-language Lambda functions for use on a Snowball Edge. For a sample on how to use the Lambda console, see Step 2: Create a HelloWorld Lambda Function and Explore the Console in the Amazon Lambda Developer Guide.

  • Python – The high-level programming language used for your Lambda functions powered by Amazon IoT Greengrass on a Snowball Edge. Amazon IoT Greengrass supports Python version 2.7.

The following topics are related to running Amazon Lambda powered by Amazon IoT Greengrass functions on a Snowball Edge:

Next:

Getting Started with Lambda Powered by Amazon IoT Greengrass