Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: Port, debug, and document createIoTThings.py #82

Merged
merged 1 commit into from
Aug 22, 2024

Commits on Aug 21, 2024

  1. tools: Port, debug, and document createIoTThings.py

    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]>
    RC-Repositories committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    3681da8 View commit details
    Browse the repository at this point in the history