How-To Guides
Integration Guides

Amazon AWS IoT Core over SSL Integration Guide

15min

Review the following guide to set up an integration between Litmus Edge and AWS IoT Core with SSL authentication.

Before You Begin

You must have an AWS account with the appropriate user privileges.

Set Up Integration in AWS

Step 1: Onboard Device

To onboard a device:

  1. Open the AWS IoT browser tab and click Manage > Things. The Things pane appears.
  2. From the left pane, click Onboard. The Connect to AWS IoT pane appears.

    Connect to AWS IoT pane
    Connect to AWS IoT pane
    
  3. From the Onboard a device box, click Get Started. The Connect to AWS IoT wizard appears.

    Connect to AWS IoT wizard
    Connect to AWS IoT wizard
    
  4. Click Get Started. The How are you connecting to AWS IoT screen appears.

    How are you connecting to AWS IoT screen
    How are you connecting to AWS IoT screen
    
  5. From the Choose a platform section, select Linux/OSX.
  6. From the Choose a AWS IoT Device SDK section, select Java, and then click Next. The Register a thing screen appears.

    Register a thing screen
    Register a thing screen
    
  7. In the Name field, enter Thing1, and then click Next step. The Download a connection kit screen appears.

    Download a connection kit screen
    Download a connection kit screen
    
  8. Click Linux/OSX, view the downloaded .zip file at the bottom of the screen, and then click Next step. The Configure and test your device screen appears.

    Configure and test your device screen
    Configure and test your device screen
    
  9. View the downloaded .zip file at the bottom of the screen, and then click Done. The Connected successfully screen appears.

    Connected successfully screen
    Connected successfully screen
    
  10. Click Done. The named Thing1 appears in the Things pane.

Step 2: Create Policy

To create the policy:

  1. From the left pane in the AWS Things pane, click Secure > Policies.
  2. Refresh the page. The named Thing1-Policy appears.

    Policy item
    Policy item
    

Step 3: Create and Download Certificate and Private Key

You will need to download the certificate and private key that you will use to configure the AWS connector in Step 8.

To create and download the certificate and private key:

  1. From the left pane, click Certificates. The certificate for the named Thing appears.

    Certificate pane
    Certificate pane
    
  2. Click the Actions icon for the certificate, and select Delete. The Confirmation dialog box appears.
  3. Click Yes, continue with delete.
  4. Refresh the page. The Certificates wizard appears.

    Certificate wizard
    Certificate wizard
    
  5. Click Create a certificate. The Create a certificate screen appears.

    Create a certificate screen
    Create a certificate screen
    
  6. Click Create certificate. The Certificate created screen appears.

    Certificate created screen
    Certificate created screen
    
  7. Click Download next to A certificate for this thing.
  8. Click Download next to A private key.
  9. Click Keep next to the downloaded files.
  10. Click Activate, and then click Attach a policy. The Add authorization to certificate screen appears.

    Add authorization to certificate screen
    Add authorization to certificate screen
    
  11. Select the named Thing1-Policy, and then click Done.

    Document image
    

Step 4: Edit Policy

To edit the policy:

  1. From the left pane, click Policies. The Policies pane appears.
  2. Click the named Thing1-Policy. The named Thing1-Policy dialog box appears.

    Policy dialog box
    Policy dialog box
    
  3. Click Edit policy document. The Edit Policy screen appears.

    Edit Policy screen
    Edit Policy screen
    
  4. Scroll down the policy document, copy the last line, paste the copied line below, and edit it as follows: Change sdk-nodejs to sdk-golang.

    Edit policy code
    Edit policy code
    
  5. Click Save as new version.
  6. Click the Back arrow to return to the Policies pane.

Set Up Integration in Litmus Edge

After setting up your AWS account, you will need to log in to Litmus Edge to complete the steps below and complete the integration.

Step 5: Add Device



Step 6: Add Tag to Device



Step 7: Retrieve Parameters for AWS Connector

You will have to log in to your AWS account to retrieve the parameters for the AWS connector.

To retrieve the parameters:

  1. Log in to your AWS account.
  2. Open the AWS IoT browser tab and click Manage > Things. The Things pane appears.
  3. Click Thing[#]. The Thing[#} dialog box appears.
  4. From the left pane, click Interact. The pane changes to reflect your selection.
  5. Copy the REST API Endpoint under the HTTPS section. This is the Hostname parameter for the AWS connector.
  6. Click Secure > Policies. The Policies pane appears.
  7. Click Thing[#]-Policy. The Thing[#]-Policy dialog box appears.
  8. Scroll to the bottom and copy SDK resource to your clipboard. For this use case, the SDK resource is sdk-golang. This is the Client ID parameter for the AWS connector.

    The SDK resource value
    The SDK resource value
    
  9. Copy the first topic value. In this use case, the topic is topic_1. This the Integration Topic value.

    The topic value
    The topic value
    

Step 8: Add AWS IoT Core Connector

Follow the steps to Add a Connector and select the MQTT - Amazon AWS IoT Core over SSL provider.

Configure the following parameters.

  • Name: Enter a name for the connector.
  • Hostname: Paste the REST API Endpoint value copied in Step 6.
  • Port: Enter the MQTT broker port. The default value is 8883.
  • Certificate: Paste the downloaded certificate in Step 3.
  • Private key: Paste the downloaded private key in Step 3.
  • Client ID: Paste the SDK resource copied in Step 6.
  • QoS: Confirm that the default value 0 is entered. The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message.
  • Parallel Publish Count: The number of messages being published simultaneously. Once the defined limit has been reached, subsequent messages are silently dropped. The default value is 100.
  • Integration Topic: Paste the topic value copied in Step 6.
  • LWT topic: The topic for Last Will and Testament feature of MQTT.
  • LWT payload: The payload for Last Will and Testament feature of MQTT.
  • LWT payload type: The payload type for MQTT's Last Will and Testament feature. The options are string and base64.
  • LWT QoS: The Quality of Service value for MQTT's Last Will and Testament feature.
  • LWT retained: Select this check box to retain the value for MQTT's Last Will and Testament feature.
  • Throttling limit: The maximum number of messages per second to be processed. The default value is zero, which means that there is no limit.
  • Persistent storage: When enabled, this will cause messages to undergo a store-and-forward procedure. Messages will be stored within Litmus Edge when cloud providers are online.
  • Queue Mode: Select the queue mode as lifo (last in first out) or fifo (first in first out). Selecting lifo means that the last data entry is processed first, and selecting fifo means the first data entry is processed first.

Step 9: Enable the Connector

After adding the connector, click the toggle in the connector tile to enable it.

Document image


If you see a Failed status, you can review the Connector Logs and relevant error messages.

Step 10: Create Topics for Connector

You will now need to create topics for the connector. To create outbound topics, you have the option of importing the tag created in Step 6. To create inbound topics, you will have to manually create the topic.



Step 11: Enable Topics



Step 12: Verify Outbound Messages

You will need to log in to your AWS account to verify that outbound messages are being sent.

To verify outbound messages:

  1. Log in to your AWS account.
  2. Navigate to the AWS Things pane and click Monitor. The Monitor pane appears.
  3. Select Hour from the Time range drop-down list. The charts change to reflect your selection.
  4. Click the browser Refresh to refresh the page. The Successful connections chart shows a connection.
  5. Scroll down to the Messages published chart. The Messages published chart shows messages arriving.

Step 13: View Outbound Messages in Litmus Edge Flow

You can create a flow in Litmus Edge to view the outbound messages.

To create a flow:

  1. Follow the steps to Create a Flow and add the following nodes.
    • DataHub Subscribe
    • Debug
  2. Double-click the DataHub Subscribe node. The Edit DataHub Subscribe node dialog box appears.
  3. Paste the local topic you created in Step 9.
  4. If needed, configure the Datahub Subscribe connection. See the "Step 3: Configure Connector Nodes" section in Create a Flow to learn more.
  5. Click Done, and then click Deploy.
  6. Click the debug tab. See the Additional Options section in Manage the Flow Canvas for more details.
  7. Verify that Test Message appears in the debug results.

You can return to AWS Monitor browser tab and view the Messages published chart to see the outbound messages are being sent.