The script contains tools used to create, destroy, and manage AWS IoT
Things, Policies, Buckets, Roles, and Jobs. It is intended to
automate the process of creating an OTA update.
The script was previously in a deprecated project.
Documentation for the script was also ported to
`/docs/components/aws_iot/aws_tool.md``.
Modified the aws_tool.md file with the following:
1. Fix paths from total-solutions.
2. Remove deprecated references (e.g. ats.sh)
3. Clarifications added (e.g. where to get AWS API keys).
4. Remove duplicate sections that have been ported already.
This commit links to this documentation in the top-level `README.md`,
under a section called 'Tools'.
Modified createIoTThings.py with the following:
1. comment all functions with Python Docstrings.
2. debug and refactor createIoTThings.py as detailed below.
3. Fix filenames and directories from deprecated total-solutions.
Total-solutions saved all credentials to the same .h file, but build.sh
in this project takes credentials from separate files.
This commit stores generated credentials for new objects in
the `credentials` directory by default, with unique file names per
Thing.
The user can optionally specify the credentials directory.
This commit makes it possible to do any operation except for an OTA
image update if update-signature.txt is not in the correct directory.
A warning is generated if update-signature.txt is not present.
This commit improves --help messages for the script.
This commit places additional user input checks e.g.
permissions_boundary must be of a certain format. Previous error
messages were confusing.
fix: does not forget to pass role name during role creation.
fix: _does_role_exist handles None and "" cases.
fix: cleanup after command failure. Do not delete a role if it already
existed before the script ran.
fix: create-update-only now gets role ARNs correctly.
fix: create-policy-only now passes thing name and policy name correctly.
fix: create-policy-only does not allow empty policy name or thing name.
fix: correct help messages e.g. for create-update-only.
Some other minor fixes also exist.
This script updates
`/applications/<target_application>/configs/aws_config/
aws_clientcredentials.h` once a Thing is created, where
`<target_application>` is specified on the CLI. If the file has been
previously modified, the script asks before overwriting.
This saves the user modifying the file.
Signed-off-by: Reuben Cartwright <[email protected]>