

End of support notice: On May 20, 2026, Amazon will end support for Amazon IoT Events. After May 20, 2026, you will no longer be able to access the Amazon IoT Events console or Amazon IoT Events resources. For more information, see [Amazon IoT Events end of support](https://docs.amazonaws.cn/iotevents/latest/developerguide/iotevents-end-of-support.html).

# Best practices for Amazon IoT Events
<a name="best-practices"></a>

Follow these best practices to get the maximum benefit from Amazon IoT Events.

**Topics**
+ [Enable Amazon CloudWatch logging when developing Amazon IoT Events detector models](#best-practices-cw-logs)
+ [Publish regularly to save your detector model when working in the Amazon IoT Events console](#best-practices-console)

## Enable Amazon CloudWatch logging when developing Amazon IoT Events detector models
<a name="best-practices-cw-logs"></a>

Amazon CloudWatch monitors your Amazon resources and the applications that you run on Amazon in real time. With CloudWatch, you gain system-wide visibility into resource use, application performance, and operational health. When you develop or debug an Amazon IoT Events detector model, CloudWatch helps you know what Amazon IoT Events is doing, and any errors that it encounters.

**To enable CloudWatch**

1. If you haven't already, follow the steps in [Setting up permissions for Amazon IoT Events](iotevents-permissions.md) to create a role with an attached policy that grants permission to create and manage CloudWatch logs for Amazon IoT Events.

1. Go to the [Amazon IoT Events console](https://console.amazonaws.cn/iotevents/).

1. In the navigation pane, choose **Settings**.

1. On the **Settings** page, choose **Edit**.

1. On the **Edit logging options** page, in the **Logging options** section, do the following:

   1. For **Level of verbosity**, select an option.

   1. For **Select role**, select a role with sufficient permissions to perform the logging actions that you chose.

   1. (Optional) If you chose **Debug** for the **Level of verbosity**, you can add Debug targets by doing the following:

      1. Under **Debug targets**, choose **Add Model Option**.

      1. Enter a **Detector Model Name** and (optional) **KeyValue** to specify the detector models and specific detectors (instances) to log.

1. Choose **Update**.

Your logging options are successfully updated.

## Publish regularly to save your detector model when working in the Amazon IoT Events console
<a name="best-practices-console"></a>

When you use the Amazon IoT Events console, your work in progress is saved locally in your browser. However, you must choose **Publish** to save your detector model to Amazon IoT Events. After you publish a detector model, your published work will become available in any browser that you use to access your account.

**Note**  
If you don't publish your work, it will not be saved. After you publish a detector model, you can't change its name. However, you can continue modifying its definition.