This is a very basic AWS Amplify + AWS IoT Javascript SDK + React project that combines basic authentication via Amazon Cognito with AWS IoT Core pubsub via the aws-iot-device-sdk to (1) authenticate via Cognito, (2) subscribe to one or more topics and (3) publish messages to a user-specified topic.
The functionality is similar to (though simpler, less pretty) version of the "Test" tab in the AWS IoT console:
View the live demo here: https://master.d3lu5yrdzirdad.amplifyapp.com/
-
Navigate to the Amplify Console Home Page
-
Choose "Connect App" and link to the https://github.com/matwerber1/aws-amplify-react-template GitHub repo.
-
Deploy the app from the Amplify Console
-
Once app completes, navigate to app endpoint (as shown in Amplify console), and create yourself a new user.
-
Log in to the endpoint (as shown in Amplify Console) with your newly-created user.
-
Make note of the "Auth Identity ID".
-
Per instructions in manual-steps.md, create a new IoT policy named "ReactIotPolicy".
-
Per instructions in manual-steps.md, issue CLI command to grant your user's auth identity ID (Step 6) access to the new IoT policy (Step 7).
-
Per instructions in manual-steps.md, edit your authorized users' IAM role to have permission to connect/publish/subscribe to AWS IoT.
-
That should be it!