Menu
AWS Greengrass
Developer Guide

Configure Subscriptions

  1. In the AWS IoT console, choose Greengrass, Groups, and then your group. Choose Subscriptions and then Add Subscriptions. Now create a subscription such that the GG_TrafficLight shadow sends updated states to the GG_Car_aggregator Lambda function, as shown:

    
                            The Select your source and target webpage with source set to
                                Local Shadow Service and target set to the GG_Car_Aggregator Lambda
                                function.

    Set the subscription to $aws/things/GG_TrafficLight/shadow/update/documents, as shown:

    
                            Optional topic filter field set to
                                $aws/things/GG_TrafficLight/shadow/update/documents.

    This subscription is in addition to the other subscriptions you created in Module 5. The following table shows the complete list of required subscriptions. The new shadow subscription appears in the last row of the table:

    Source Target Topic Notes

    GG_Switch

    Local Shadow Service

    $aws/things/GG_TrafficLight/shadow/update

    The GG_Switch sends an update request to update topic.

    Local Shadow Service

    GG_Switch

    $aws/things/GG_TrafficLight/shadow/update/accepted

    The GG_Switch needs to know whether the update request was accepted or rejected.

    Local Shadow Service

    GG_Switch

    $aws/things/GG_TrafficLight/shadow/update/rejected

    The GG_Switch needs to know whether the update request was accepted or rejected.

    GG_TrafficLight

    Local Shadow Service

    $aws/things/GG_TrafficLight/shadow/update

    The GG_TrafficLight sends an update of its state to the update topic.

    Local Shadow Service

    GG_TrafficLight

    $aws/things/GG_TrafficLight/shadow/update/delta

    The shadow service sends a received update to GG_TrafficLight through the delta topic.

    Local Shadow Service

    GG_TrafficLight

    $aws/things/GG_TrafficLight/shadow/update/accepted

    The GG_TrafficLight needs to know whether the update request from GG_Switch was accepted or rejected.

    Local Shadow Service

    GG_TrafficLight

    $aws/things/GG_TrafficLight/shadow/update/rejected

    The GG_TrafficLight needs to know whether the update request from GG_Switch was accepted or rejected.

    Local Shadow Service

    GG_Car_Aggregator:GG_CarAggregator

    $aws/things/GG_TrafficLight/shadow/update/documents

    The GG_TrafficLight shadow sends updated states to the Lambda function.

    Note

    Except for Module 5, you can delete the subscriptions from earlier modules that are not included in the above table.

    The AWS IoT console analog of the table is shown next:

    
                            List of subscriptions with Source set to Local Shadow Service,
                                Target set to GG_Car_Aggregator, and Topic set to
                                $aws/things/GG_TrafficLight/shadow/update/documents.
  2. Choose Actions and deploy the modified group configuration to the AWS Greengrass core.