Enable registry events

AWS IoT publishes event messages when certain events occur. For example, events are generated by the Registry when things are added, updated, or deleted. Each event causes a single event message to be sent. Event messages are published over MQTT with a JSON payload. The content of the payload depends on the type of event.

The device registry posts messages to topics under the topic structure $aws/events/# for several actions, for example when things are created/updated/deleted.

In this exercise you will enable IoT Events. You will use IoT Events in the following exercises in this workshop.

Get event configuration

With the following command you can determine which IoT Events are enabled or disabled.

In a Cloud9 terminal:

aws iot describe-event-configurations

Enable all events

Use the following command to enable all events.

In a Cloud9 terminal:

aws iot update-event-configurations --cli-input-json \
'{
    "eventConfigurations": {
        "THING_TYPE": {
            "Enabled": true
        },
        "JOB_EXECUTION": {
            "Enabled": true
        },
        "THING_GROUP_HIERARCHY": {
            "Enabled": true
        },
        "CERTIFICATE": {
            "Enabled": true
        },
        "THING_TYPE_ASSOCIATION": {
            "Enabled": true
        },
        "THING_GROUP_MEMBERSHIP": {
            "Enabled": true
        },
        "CA_CERTIFICATE": {
            "Enabled": true
        },
        "THING": {
            "Enabled": true
        },
        "JOB": {
            "Enabled": true
        },
        "POLICY": {
            "Enabled": true
        },
        "THING_GROUP": {
            "Enabled": true
        }
    }
}'