Skip to main content

AWS CUI Application

Project description

pyaws-logo-png

pyaws_cui (pyaws)

A Python based Command User Interface for viewing AWS resource detail information.

Prologue

Built using the py_cui framework, with direct porting from pyautogit. Many thanks to Jakub Wlodek for 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.

Installation

To install pyaws_cui, use pip:

pip install pyaws-cui

pyaws

Since py_cui is 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, a curses emulator, will also be installed.

Build from source:

git clone https://github.com/j-lavender/pyaws_cui.git
cd pyaws_cui
pip install .

Usage

This 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/credentials and contains at least one profile. awscui supports 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:

pyaws

Demo

pyaws-demo-gif

When 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 is us-east-1.

Current Profile and Region selection is saved to $PWD/.pyaws/metadata.json upon 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 Resources

  • EC2
    • Instances
    • Images
    • Volumes
    • Snapshots
    • Security Groups
    • Key Pairs
    • Elastic IPs
    • Load Balancers
    • Target Groups
    • Launch Templates
    • Auto Scaling Groups
  • IAM
    • Users
    • Groups
    • Roles
    • Policies
  • Route53
    • Hosted Zones
  • Secrets Manager
    • Multi-version support
  • Systems Manager
    • Paramater Store

Local Development

Setup

For local development and testing, I have been using LocalStack to 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/credentials exists, along with a LocalStack profile exists.

[localstack]
aws_access_key_id = test
aws_secret_access_key = 123
endpoint_url = http://localhost:4566

The simple bash script located in scripts/ 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 2

Run

Run 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 -d

Generate documentation

To re-generate the auto-generated documentation, use the script located in docs/scripts:

cd docs/scripts/
./generateFromDocstrings.sh

License

BSD 3-Clause License

Copyright (c) 2024, James Lavender All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyaws_cui-0.0.1.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyaws_cui-0.0.1-py3-none-any.whl (61.5 kB view details)

Uploaded Python 3

File details

Details for the file pyaws_cui-0.0.1.tar.gz.

File metadata

  • Download URL: pyaws_cui-0.0.1.tar.gz
  • Upload date:
  • Size: 49.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for pyaws_cui-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1c8247eb997d1e1895695dcc156eac8d8ff9d8faec3ee8b0829a94afc0d23235
MD5 19c8745ebc6ff2c4a7e089c3a8787337
BLAKE2b-256 06251df0a059bba841cbaf53c09a025494d38bbabdaf02bf706907cb2c89a2c3

See more details on using hashes here.

File details

Details for the file pyaws_cui-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyaws_cui-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 61.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for pyaws_cui-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a6375085887b38478b9a2d92f6555759ed5d4b4974ec244055d08ad5b00bc8a
MD5 635f8e6771dfd74e3d0d6c202ebc6733
BLAKE2b-256 87d69c99d8b59a17f3cbc9587f46982f2a3a36ac318907ade33640524dac7faf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page