# IoT (Internet of Things)

Connect and manage billions of devices with AWS IoT, per Tenant. Collect, store, and analyze IoT data for industrial, consumer, commercial, and automotive workloads within DuploCloud.

{% hint style="info" %}
Use [Just-In-Time access](https://docs.duplocloud.com/docs/automation-platform/overview/use-cases/jit-access) to provision devices in your IoT.
{% endhint %}

## Enabling IoT for a Tenant

1. In the DuploCloud Portal, navigate to **Administrator** -> **Tenants**.
2. Select your Tenant in the **Name** column.
3. Click the **Settings** tab.
4. Click **Add**. The **Add Tenant Feature** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FwU5RAGdHP6dJCiG95GPc%2FAWS_IOT_Create.png?alt=media&#x26;token=9a9db4a1-1867-4db3-ba51-97315ff69f7d" alt=""><figcaption><p><strong>Add Tenant Feature</strong> pane with <strong>Enable AWS IoT</strong> feature selected</p></figcaption></figure></div>
5. From the **Select Feature** list box, select **Enable AWS IoT** and **Enable**.
6. Click **Add**. It takes approximately five minutes to enable IoT.
7. Navigate to **Cloud Services** -> **IoT**. The IoT **Things** page displays.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fu3tkkbfDhyikbzqeuX6k%2Fscreenshot-nimbusweb.me-2024.02.19-16_30_26.png?alt=media&#x26;token=603b2b97-57e9-4da4-85a0-c7ecf017200f" alt=""><figcaption><p>IoT <strong>Things</strong> page</p></figcaption></figure>

## Creating IoT Things

1. In the DuploCloud Portal, navigate to **Cloud Services** -> **IoT**.
2. Click the **Things** tab.
3. Click **Add**. The **Create an IoT Thing** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FCgyNrqrFjd8hajxELUtK%2FIOT_Create_Thing_Attr.png?alt=media&#x26;token=c5d3141b-4b00-46c9-8cce-ceec48f66521" alt="" width="563"><figcaption><p><strong>Create an IoT Thing</strong> pane with <strong>AttributesACtions</strong></p></figcaption></figure></div>
4. In the editable portion of the **Name** field, enter a Thing name.
5. From the **IoT Certificate** list box, select an IoT Certificate.
6. From the **IoT Thing Type** list box, select the Thing type that you want to create.
7. In the **Attributes** field, add Thing Attributes in quotes, separated by a comma (**,**).
8. Click **Create**. Your IoT Thing is created and displayed.

Select the Thing to view **Details** and **IoT Principals** (certificate information) for the Thing. Use the **Action** menu to **Edit** or **Delete** the Thing, **Attach IoT Certificate**, and **Download Device Package**.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fux0Wn16uLi3dBpwCQr2V%2Fscreenshot-nimbusweb.me-2024.02.19-16_32_37.png?alt=media&#x26;token=d1a57d98-87bb-49de-8361-b744a8c08bd6" alt=""><figcaption><p><strong>Details</strong> and <strong>IoT Principals</strong> tabs on IoT <strong>Things</strong> page</p></figcaption></figure>

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fek12PMIQMq9atVllflf0%2Fscreenshot-nimbusweb.me-2024.02.19-16_33_06.png?alt=media&#x26;token=6b218f63-9e42-4974-a273-c093bd34ad41" alt=""><figcaption><p><strong>Actions</strong> menu on IoT <strong>Things</strong> page</p></figcaption></figure>

## Attach a certificate to a Thing

1. In the DuploCloud Portal, navigate to **Cloud Services** -> **IoT**.
2. Click the **Things** tab.
3. [Add a certificate](#adding-a-certificate) if needed.
4. Select the Thing to which you want to attach a certificate from the **Name** column.
5. Click the Actions menu and select **Attach IoT Certificate**. The **Attach an IoT Certificate** pane displays.
6. From the **IoT Certificate** list box, select an IoT certificate to attach to the Thing.
7. Click **Attach**.

## Download the Device Package for a Thing

1. In the DuploCloud Portal, navigate to **Cloud Services -> IoT**.
2. Click the **Things** tab.
3. Select the Thing to which you want to attach a certificate from the **Name** column.
4. Click the **Actions** menu and select **Download Device Package**. The **Download IoT Device Package** window displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FtMbkB2EPh7tUhnJATz6Z%2FIOT_Download.png?alt=media&#x26;token=8d4f917b-16a7-42ff-8804-e0b12c7656b8" alt=""><figcaption></figcaption></figure></div>
5. From the **IoT Certificate** list box, select the IoT certificate associated with the Thing's Device Package.
6. Click **Download**.

## Certificate management

Add, update, or manage an IoT certificate with the following procedures.

### Adding a certificate

1. In the DuploCloud Portal, navigate to **Cloud Services** -> **IoT**.
2. Click the **Certificates** tab.
3. Click **Add**. The **Create an IoT Certificate** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FFOkkqZegeAvREFtvXN1R%2FIOT_create_cert.png?alt=media&#x26;token=537d1ff3-c214-40e5-b474-e32cab3f2d7c" alt=""><figcaption><p><strong>Create an IoT Certificate</strong> pane</p></figcaption></figure></div>
4. Select **Activate the Certificate** and click **Create**. The certificate displays.

### Updating a certificate

1. In the DuploCloud Portal, navigate to **Cloud Services** -> **IoT**.
2. Click the **Certificates** tab. The available certificates are displayed and listed by **ID**.
3. In the row for the certificate you want to update, click the **Actions** menu ( <img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FiNwYVMf4fky7ZPl41t38%2FKabab_three_Vertical_dots.png?alt=media&#x26;token=566b1d4e-a9bc-43c8-995a-044ceab9f38b" alt="" data-size="line"> ) and select **Edit**. The **Update an IoT Certificate** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FQP3sxybXFWAgynhHFO1p%2FIOT_update_cert.png?alt=media&#x26;token=7ccc3f81-420d-4fcd-9f4c-12271d4fd9be" alt=""><figcaption></figcaption></figure></div>
4. From the **Status** list box, select the new status of the certificate.
5. Click **Update**.

### Manage a certificate using AWS Console

1. In the DuploCloud Portal, navigate to **Cloud Services** -> **IoT**.
2. Click the **Certificates** tab. Available certificates are displayed and listed by **ID**.
3. In the row for the certificate you want to update, click the menu (<img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FiNwYVMf4fky7ZPl41t38%2FKabab_three_Vertical_dots.png?alt=media&#x26;token=566b1d4e-a9bc-43c8-995a-044ceab9f38b" alt="" data-size="line">) icon in the **Actions** column.
4. Select **Console**. The AWS Console launches so that you can manage your certificate using AWS.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2F6r4B6Qz9AByr9E77ZCAp%2FIOT_AWS_console.png?alt=media&#x26;token=647331af-22c6-4179-93d0-611f212e8935" alt=""><figcaption><p>AWS Console for managing certificates</p></figcaption></figure>

## Using IoT Topic Rules

Topic Rules are SQL-based rules that select data from message payloads and send data to other services, such as Amazon S3, Amazon DynamoDB, and AWS Lambda. Define a Rule to invoke a Lambda function when invoking an AWS or third-party service.

To learn more about IoT Topic Rules and how you define and manage them, see the [AWS documentation](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rules.html).

### Adding IoT Topic Rules

1. In the DuploCloud Portal, navigate to **Cloud Services -> IoT**.
2. Click the **Topic Rules** tab.
3. Click **Add**. The **Add** Topic Rules page displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FVHVdxApjd9EAkdkksVdA%2FIOT_R_1.png?alt=media&#x26;token=c7ce1bc3-08ee-4fb5-9082-863fc915ed5a" alt=""><figcaption><p><strong>Add</strong> Topic Rules page</p></figcaption></figure></div>
4. In the **Name** field, enter a Topic Rule name.
5. Add a meaningful description of what the rule does in the **Description** field.
6. Define the rule by completing the fields in the **AWS IoT SQL** and **AWS IoT SQL Version** areas. Select **Define an Error Action** if the rule pertains to error management.
7. Click **Create**. Your rule is defined and displayed in the **Topic Rules** tab.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FzT0G3RA6HbX8ztXScqIG%2Fscreenshot-nimbusweb.me-2024.02.19-16_41_46.png?alt=media&#x26;token=6c68ad06-c268-4042-b196-38f196cc748e" alt=""><figcaption><p>An IoT Topic Rule in the <strong>Topic Rules</strong> tab</p></figcaption></figure>

### Viewing a Topic Rule

View the details of a rule by selecting the rule from the **Topic Rules** tab Name column. The **Details** tab displays the rule description. The **Actions** tab displays the SQL-based rule(s).

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fer6RQTnbmhAu0H1eC3vz%2Fscreenshot-nimbusweb.me-2024.02.19-16_43_00.png?alt=media&#x26;token=096f4a75-b422-47ae-b450-c780fee7577e" alt=""><figcaption><p>Topic Rule <strong>Details</strong> tab</p></figcaption></figure>

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FlWXC6FkvZtoWqbid7OP4%2Fscreenshot-nimbusweb.me-2024.02.19-16_44_03.png?alt=media&#x26;token=53e9c765-cd1a-4bc4-ab72-795142c2aaeb" alt=""><figcaption><p>Topic Rule <strong>Actions</strong> tab</p></figcaption></figure>

### Editing a Topic Rule

In the **Topic Rules** tab, edit a Topic Rule by clicking the **Actions** menu ( <img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FiNwYVMf4fky7ZPl41t38%2FKabab_three_Vertical_dots.png?alt=media&#x26;token=566b1d4e-a9bc-43c8-995a-044ceab9f38b" alt="" data-size="line"> ) in the row listing your Topic Rule **Name**, and selecting **Edit**.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FnblgCnxF2NyVS3AezpQS%2Fscreenshot-nimbusweb.me-2024.02.19-16_46_04.png?alt=media&#x26;token=0d1e29be-034d-4648-ad43-a12e5532b176" alt=""><figcaption><p><strong>Actions</strong> menu with <strong>Edit</strong> option on <strong>Topic Rules</strong> tab</p></figcaption></figure>
