This is a simple Command Line Interface (CLI) for interacting with the AWS IoT managed service on AWS. It allows you to create things, list things, and perform other operations related to the provisioning and management of IoT devices.
Before you begin, make sure you have the following installed on your system:
- CMake (minimum version 3.5)
- Ninja (or any other build system supported by CMake)
- C++ compiler with C++11 support
Follow these steps to build and run the AWS IoT CLI:
-
Clone the Repository:
git clone https://github.com/thathardwareguy/Aws-IoT-CLI.git cd awsiotcli
-
Create a Build Directory:
mkdir build cd build
-
Generate Build Files:
cmake -G Ninja ..
-
Compile using Ninja:
ninja
-
Run the AWS IoT CLI:
./awsiotcli
-
Git Bash:
- Install Git for Windows
- Launch Git Bash from the Start menu
- Follow the Linux instructions above
-
Ubuntu for Windows:
- Install Ubuntu for Windows
- Launch Ubuntu from the Start menu
- Follow the Linux instructions above
-
Once the CLI is running, you will see a menu with options to perform various operations related to AWS IoT. Follow the on-screen prompts to interact with the CLI.
-
Enter the absolute path of the working directory: In my case, the absolute working directory is in my Ubuntu for Windows Environment:
/mnt/c/Users/user/Desktop/Embedded_Systems/awsiotcli/
The working directory is essential to ensure that the certificates generated are placed in the specified location of the user.
-
Choose "Create Thing" (Option 1)
-
Enter the name of the thing to be created:
Ensure that there is a
policy.json
file in the specified working directory. Thepolicy.json
file contains the access policies for the created IoT thing.Once the device is successfully created, you will get an output similar to this below.
The specified directory should now contain the device certificates and keys.
If you'd like to contribute to this project, feel free to fork the repository and create a pull request.