Update content

How to create an IoT Hub route

Reviewed on 19 June 2023 • Published on 01 September 2019

Routes allow your IoT Hub to forward messages to non-MQTT destinations.

Currently, the following routes are available:

  • REST Route allowing you to call a REST API with the content of your messages.
  • Database Route allowing you to execute queries on a PostgreSQL or MySQL database with the content of your messages.
  • Scaleway Object Storage Route allowing you to store your messages in your Scaleway Object Storage bucket.
Security & Identity (IAM):

You may need certain IAM permissions to carry out some actions described on this page. This means:

  • you are the Owner of the Scaleway Organization in which the actions will be carried out, or
  • you are an IAM user of the Organization, with a policy granting you the necessary permission sets
Requirements:
  1. Click IoT Hub in the Managed Services section of the side menu. The list of your IoT Hubs displays.
  2. Click the name of the IoT Hub you want to configure. The hub’s overview page displays.
  3. Click Routes to display the routes configuration.
  4. Click Create route in the routes tab. The Add a new route wizard displays.
  5. Complete the following steps of the wizard:
    • Enter a name for your route.
    • Enter the topic filter you want your route to subscribe to. This topic filter can contain wildcards (+ and #).
    • Choose the type of Route you want to create.
    • Configure the settings according to the type of route.
      • For an Object Storage Route:
        • Select the region of your Object Storage bucket.
        • Choose the bucket you want to store messages in (you cannot directly create a bucket from the «Object Storage» Route screen).
        • Enter the prefix that will be prepended to object names.
        • Select how your messages will be stored in the bucket (per topic or per message).
      • For a Managed Databases Route:
        • Enter the SQL query to be executed when the topic filter is matched.
        • Enter the settings to access to the database:
          • Engine: PostgreSQL or MySQL
          • Host: host name or IP address
          • Port: port number
          • Name: name of the database
          • Username: username to use while connecting to the database
          • Password: password of the user
      • For a REST Route:
        • Choose the HTTP Verb used to call the URI.
        • Enter the REST Route endpoint.
        • Add optional HTTP headers.
  6. Click Add new route to create the route.
See Also