Step 3: Connecting to Amazon AWS

Modified on Wed, 19 May, 2021 at 1:15 PM


AWS IoT Core Configuration


This tutorial explains how to configure your AWSS IoT Core instance and connect your CloudGate to it using the CloudWizzard application for CloudGate.



Start by logging in to the AWS IoT Console using valid credentials and Click on “Connect an IoT Device”.                                                                

                                     

Create a thing


Click on ‘Manage’ and  under ‘Things’ then Click on ‘Create’. 

                                               


To register a single AWS IoT thing, Click on ‘Create a single thing’:

                                            

Type a name for the new thing (eg: MyCloudgate) and Click on ‘next’.


Add a certificate 

Click on ‘Create Certificate’ in order to generate a certificate for authenticating our communication between the CloudGate and the AWS IoT platform. This will generate a certificate, public key and private key using AWS IoT’s certificate authority.

                          

Then you will get links to download your certificates. For the first three certificates, please download them into your PC and store them onto a known location.


                 

When you click to download your Root CA certificates, a separate web page will appear and in this web page you click on the first option which is highlighted below:

                      

This will take you to another web page. Copy the text and save it in a file called "Amazon_Root_CA_1" with ".pem" extension.


 Then copy the other downloaded certificates to the same folder on your PC:

                  

Now you can click on ‘Activate’ to activate all certificates.

                         

                   

 Create a Policy


From AWS IoT console Home page, Select ‘Secure’ and under ‘Policies’ Click on ‘Create’:


  Type a name for the new policy:

 

                           

Add Policy statements like in the screenshot below and Click on ‘Create’:

                                                                    

Attach the policy to your thing

Go to ‘Manage’ and under Thing, select your thing(eg: MyCloudgate).



                    

Select ‘Security’ and choose the certificate that you created earlier.


                        

In the Certificates page, under ‘Actions’ choose ‘Attach Policy’.


 

And then select the policy that you want to attach and Click on ‘Attach’.

 

Get the MQTT broker address

 

Go back to the AWS console home page and Click on ‘Manage’. Under thing select your thing and click on ‘Interact’.


            

Copy the MQTT broker address and go for CloudGate configuration


CloudGate Configuration


1. Browse to the "Main menu"  ->  "Wizzard" 

2. In the CloudGate wizzard overview page, enable the  AmazonAWS-MQTT on the output side 

    and click on its Configuration


3. You have to configure the "Connection Settings" like in screenshot 

    a. Toggle  the Enabled button to YES

    b. The broker address here is the one which you copied from the AWS IoT platform.

    c. The Amazone Root-CA certificate is already present on the CloudGate by default

    d. Click on Present Client cert YES.

    e. Open the certificate.pem file that you downloaded from amazon and copy the content 

        into the client cert section.

    f. For the Private Key, you need to convert it to the PKCS8 format by using the command                                   "openssl pkcs8 -in 7f642b4034-private.pem.key -topk8 -nocrypt -out pkcs8_key.pem"

      in Linux machine. Then copy and paste the content of the file private.pem into

      the Client key section.



     g. Enter the "Client ID" and the Click on "Save Changes". Then you can see the "Status" has 

        changed to connected if everything went right.



4. Now on Amazon AWS IoT Core Home menu, in the left overview window, select "Test" and 

enter the topic as "#" and Click on "Subscribe". This will subscribe the AWS MQTT Test Client to listen to any incomming messages:



Great job! You now succesfully connected your CloudGate to your Amazon AWS IoT Core instance!





                      

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article