Package: pyaws-cui
pyaws_cui (pyaws)A Python based Command User Interface for viewing AWS resource detail information.PrologueBuilt using thepy_cuiframework, with direct porting frompyautogit. Many thanks toJakub Wlodekfor the fantastic library and example application to work from!This is my first attempt at a larger scale application. As such, this is obviously a work-in-progress. Feel free to contribute or provide feedback.InstallationTo installpyaws_cui, use pip:pip install pyaws-cui

pyawsSincepy_cuiis a dependency for this application, it will be installed as well. As noted by their documentation, if the user is on a windows machine,windows-curses, acursesemulator, will also be installed.Build from source:git clone https://github.com/j-lavender/pyaws_cui.git
cd pyaws_cui
pip install .UsageThis application assumes the user has an active AWS account with credential profiles located in~/.aws/credentials. While this application uses the Boto3 library to perform AWS actions, it is assumed the user has the AWS CLI installed locally.Ensure that AWS Credential file exists at~/.aws/credentialsand contains at least one profile.awscuisupports credential files containing multiple profiles.To start, navigate to any working directory (for example, a Terraform directory associtated with a specific AWS profile), and run the application:pyawsDemoWhen starting the application in any directory for the first time, the Account Selection screen will be shown. This provides the user with the ability to select which profile to access.Upon selection of a profile, the Console Selection screen is shown providing the user with a list of possible consoles to view, as well as a Region selection list.By default, first region selected isus-east-1.Current Profile and Region selection is saved to$PWD/.pyaws/metadata.jsonupon exit. Whenever the application is loaded again in the same directory, the previously selected Profile and Region are used by default and the Console Select screen will be displayed.Helper Args-h- Show help menu.-d- Debug mode. Prints logs to.pyaws/.-n- Do not save metadata changes on exit (region, profile, logging).-p- Set the Default Profile on start.-r- Set the Default Region on start.Supported AWS ResourcesEC2InstancesImagesVolumesSnapshotsSecurity GroupsKey PairsElastic IPsLoad BalancersTarget GroupsLaunch TemplatesAuto Scaling GroupsIAMUsersGroupsRolesPoliciesRoute53Hosted ZonesSecrets ManagerMulti-version supportSystems ManagerParamater StoreLocal DevelopmentSetupFor local development and testing, I have been usingLocalStackto simulate AWS resources. While not required, Using the free version of this cool can be much cheaper than creating resources in an AWS account. That said, I'd recommend using this if possible.Ensure LocalStack CLI is installed:https://docs.localstack.cloud/getting-started/installation/No auth key or account required. Only simple installation necessary.Once LocalStack is installed, make sure~/.aws/credentialsexists, along with a LocalStack profile exists.[localstack]
aws_access_key_id = test
aws_secret_access_key = 123
endpoint_url = http://localhost:4566The simple bash script located inscripts/can be used to generate some testing resources. Use the number designation to specify how many of each resource to create (applies to specific resources)../scripts/setupLocalstack.sh 2RunRun the application similary to the process for building the application from source. It is recommended to build this in a Python Virtual Environment to provide a local editable installation in the cloned directory.git clone https://github.com/j-lavender/pyaws_cui.git
cd pyaws_cui
pip install -e .
pyaws -dGenerate documentationTo re-generate the auto-generated documentation, use the script located indocs/scripts:cd docs/scripts/
./generateFromDocstrings.shLicenseBSD 3-Clause LicenseCopyright (c) 2024, James Lavender
All rights reserved.