Menu
AWS Greengrass
Developer Guide

Configure Subscriptions

In this step, you create a subscription that enables the GG_TrafficLight shadow to send updated states to the GG_Car_Aggregator Lambda function. This subscription is in addition to the subscriptions that you created in Module 5, which are all required for this module.

  1. On the group configuration page, choose Subscriptions, and then choose Add Subscription.

  2. On the Select your source and target page, set the following values:

    • Select a source - choose Services and then choose Local Shadow Service.

    • Select a target - choose Lambdas and then choose GG_Car_Aggregator.

    Choose Next.

    
                            The Select your source and target webpage with source set to
                                Local Shadow Service and target set to the GG_Car_Aggregator Lambda
                                function.
  3. On the Filter your data with a topic page, for Optional topic filter, type $aws/things/GG_TrafficLight/shadow/update/documents.

    Choose Next, and then choose Finish.

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

    Note

    On the Subscriptions page, the target displays the names of the function version and the alias: GG_Car_Aggregator:GG_CarAggregator.

    The following table shows the complete list of subscriptions that this module requires. The new shadow subscription appears in the last row of the table. You created the other subscriptions in Module 5.

    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

    $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 table.

  4. Make sure that the AWS Greengrass daemon is running, as described in Deploy Cloud Configurations to a Core Device.

  5. On the group configuration page, from the Actions menu, choose Deploy to deploy the updated group configuration to your AWS Greengrass core device.

    For help troubleshooting any issues that you encounter, see Troubleshooting AWS Greengrass Applications.