Deploying AWS Lambda with AWS Greengrass on Raspberry Pi 3

In general, we can deploy AWS Lambda with AWS Greengrass graphically and through command lines. In the previous section, we created the AWS Lambda function. In this section, will will deploy AWS Lambda with AWS Greengrass on Raspberry Pi 3.

You have learned how to deploy AWS Greengrass on Raspberry Pi in Chapter 3, Optimizing IoT Computing Using AWS Greengrass. Please follow the instructions in that chapter to deploy AWS Greengrass Core on Raspberry Pi.

To deploy the AWS Lambda function to AWS Greengrass Core, you should publish the AWS Lambda function and then deploy it into AWS Greengrass Group:

  1. From AWS Greengrass Group, you can add the existing Lambda function that we have already created. You just select your Lambda and its version and click on Next. Then, select on-demand function for the Lambda life cycle:
  1. Furthermore, we define the subscription on AWS Greengrass. In this scenario, we add a thing, such as a computer, that will be used to invoke this Lambda. You can do it on AWS IoT Management Console.
  2. You add a new subscription using the following configuration:
    • Source: Your thing or device
    • Target: Your Lambda function that you have created
    • Topic: test1/test2

You can see my subscriptions for the topic test1/test2 in the following screenshot:

  1. After completion, you can deploy this configuration into the AWS Greengrass Core machine, Raspberry Pi 3. Make sure the AWS Greengrass Core service has already started:

We have deployed AWS Greengrass Core. Next, we will test it by accessing from other IoT devices. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.78.237