/Python-CLI-for-AWS

CLI tool to interact with AWS services. pip install pyawscli

Primary LanguagePython

Python-CLI-for-AWS

Project logo

Python-CLI-for-AWS

Status

License


Interactive CLI created using Python 3. Trying to leverage the PyInquirer(https://pypi.org/project/PyInquirer/) Package to make a very User-Friendly CLI application with many more custom options compared to AWS CLI offers

📝 Table of Contents

🧐 About

  • This is part of a bigger project of creating a unified platform to interact with AWS services from a various interfaces (WEB,MOBILE,CLI,VOICE)
  • Interactive CLI created using Python 3.
  • Still in the works. Should be completed by year end as I am commiting consistently but once a week.

Demo:

demo Main terminal s3 terminal

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them.

  • Python 3
  • Pip
  • Virtualenv

Installing

A step by step series of examples that tell you how to get a development env running.

  • Clone the project
    git clone https://github.com/darshan-raul/Python-CLI-for-AWS.git pyawscli
    
  • Change the directory to project directory
    cd pyawscli
    
  • Install all the required dependencies
    pip install -r requirements.txt
    
  • Run locally
    python ./awscli.py
    

🚀 Deployment

If you want to create a pip package out of the code. Here are the steps

⛏️ Built Using

TODO:

  • Create another branch for testing packaging features
  • Find alternatives for relative imports beyond top level package
  • Use rebase to limit the commits that go to remote
  • Add regions choices
  • Add requirements.txt for python modules
  • Add excpetion handling
    • create a base class for exceptions defined by this cli
    • Add finally clauses wherever needed
    • Make exceptions appear in red
  • Create different classes for different AWS services:
    • S3
    • IAM
    • EC2
  • Add docstring to all functions
  • Use Spinx or Read the docs to create documentation for the package
  • Use the comment tags to filter TODO,Bugs etc in code (https://realpython.com/documenting-python-code/)
  • Have a look at other CLI offerings and look how you can do something different
  • Add confirmation before taking actions
  • Add loop to go back to main menu if back is pressed
    • Create fucntion which creates options maybe and then loop around
  • Integrate pytest to check if code is working
    • Try on single aws s3 service
    • Replicate on other services
    • Use parametrize to create multiple scenarios
  • Create Group function
  • Delete User function
  • Delete Group function
  • Try to package the choice arrays and then import in main file
  • Comment the code till now (After making packages so u can comment import statements)
  • Start instance
  • Stop instance
  • Terminate instance
  • Run instances # Lot more scope here
  • Create security groups
  • Delete security groups
  • Create VPC with CIDR
  • View the VPC networks
  • Run instances by chosing options
  • Dont print values when doing operations
  • Create keypairs
  • Delete Keypairs
  • Add progress bar when creating/deleting things
  • RDS create
  • RDS delete
  • IAM
    • Create policy by providing json policy
    • Add user to group
    • delete access key
    • create access keys
    • list access keys
    • list roles
    • Delete roles
  • Add test's using pytest by creating small scenarios
  • Add exit to main menu
  • Add keyboard shortcuts for commiting in vscode
  • FINAL : Package the whole thing and post on pypi

References/Inspiration:

https://github.com/donnemartin/awesome-aws#cli

BUGFIXES:

  • create bucket locationconstraint error