AWS IoT is a great cloud infrastructure to run secure and scalable IoT applications. Noodl has built in support for connecting to the device gateway (MQTT broker) and with the various extensions you can visually build complete IoT apps, cloud to frontend with Noodl for AWS IoT. This guide shows you how to get started by connecting to the AWS IoT device gateway.

We assume that you have an AWS account with AWS IoT enabled, if not it is really easy to get started.

The first thing you need to do is to find the endpoint and region of the AWS IoT device gateway.

  • The gateway can be found at the bottom of the overview page in AWS IoT Console home. https://console.aws.amazon.com/iot/home#/dashboard/help
  • To find the region of your AWS IoT device gateway, simply look for region= in the url you were redirected to for the AWS IoT Console. Usually it is something like “us-east-1”.

Now the final thing you need to do is to create a new AWS user that can connect to the device gateway to publish and subscribe to messages. First go to the IAM (this is where you manage users for your AWS account) service. Go here: https://console.aws.amazon.com/iam/home

  • Find the “User” tab on the panel to the left.

  • Click “Create New Users”

  • Enter a username of your choice in the top input box, for instance “NoodlEditorUser”

  • Click “Create”

  • When the user has been created, you need to find the Access Key ID and Secret Access Key. These can be shown by clicking “Show User Security Credentials” once the user is created. Copy the two keys somewhere and store them for now, or click the “Download Credentials” button to download them as a CSV file.

  • When done, click “close” to go back to the Users page. Click the newly created user to view its details. Now we must make sure it can access the AWS IoT service.

  • Switch to the “permissions” tab.

  • Expand the “Inline policies” and follow the instructions to create a new policy

  • Choose to create a custom policy. On the page where you can create the policy enter policy name: “NoodlIoTPolicy”. And copy the following policy document into the text box.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action":["iot:Publish"],
            "Resource": ["*"]
        },
        {
            "Effect": "Allow",
            "Action": ["iot:Connect"],
            "Resource": ["*"]
        },
        {
            "Effect": "Allow",
            "Action": ["iot:Subscribe"],
            "Resource": ["*"]
        },
        {
            "Effect": "Allow",
            "Action": ["iot:Receive"],
            "Resource": ["*"]
        }         
    ]
}
  • Finally click the “Apply Policy” button. Now the user we created have access to sending and receiving MQTT messages over the AWS IoT device gateway. Now it’s time to setup Noodl to connect AWS IoT.

By default, when sending and receiving messages in Noodl, an internal message broker is used so you don’t have to worry about this when starting up a design and experimenting. But it is easy to use an external broker when you move to use external hardware or cloud services.

  • Open the project settings.
  • Then find the MQTT section, enable External broker, choose AWS IoT and enter the details required to connect to the broker.
 
 

That’s it, now you can receive and send messages to external hardware and cloud services via the AWS IoT device gateway.