Git Product home page Git Product logo

aws_rds_cli's Introduction

Cli tool for clone/restore AWS RDS cluster/instances.

Tool required for human users to be able clone RDS Cluster/Instance for blue/green deployment and also restore in case of disaster recovery scenarios.

Getting Started

First of all clone this repo and change into that directory.

$ git clone https://github.com/adeelahmad84/aws_rds_cli.git
$ cd aws_rds_cli

Prerequisites

The installation into a virtualenv is heavily recommended.

Installing

You would need to install the dependancies using the following command

$ virtualenv venv
$ . venv/bin/activate
$ pip install --editable .

The script will be executabe and can be called as you would using a cli environment.

Usage

To test to see if your script has been installed properly type rds --help you should expect to see:

$ rds --help

Usage: rds [OPTIONS] COMMAND [ARGS]...

  Command Line Tool to clone and restore RDS DB instance or cluster for
  Blue-Green deployments.  Please the sub commands below.  You can also use
  the options below to get more help.

  NOTE: Please ensure the RDS instance ID is stored in your environment
  variable as DBINSTANCEID

Options:
  --help  Show this message and exit.

Commands:
  clone   Prints the ARN of the snapshot to stdout.
  deploy  Deploy new DB from snapshot and print ARN to...

If you run the help switch on each command you see the following:

$ rds clone --help

Usage: rds clone [OPTIONS]

  Prints the ARN of the snapshot to stdout.

  NOTE: Please ensure the RDS instance ID is stored in your environment
  variable as DBINSTANCEID

Options:
  --instance_id TEXT  Retrieved from ENV
  --help              Show this message and exit.




$ rds deploy --help

Usage: rds deploy [OPTIONS]

  Deploy new DB from snapshot and print ARN to stdout.

  NOTE: Please ensure the RDS instance ID is stored in your environment
  variable as DBINSTANCEID

Options:
  --instance_id TEXT  The ID of the DB Instance.
  --new_db_id TEXT    The ID of the new DB.
  --help              Show this message and exit.

Running the tests

Explain how to run the automated tests for this system

Break down into end to end tests

Explain what these tests test and why

Give an example

And coding style tests

Explain what these tests test and why

Give an example

Deployment

Add additional notes about how to deploy this on a live system

Built With

Python2.7 and using Click framework

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

To be determined.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

aws_rds_cli's People

Stargazers

 avatar

aws_rds_cli's Issues

Read from AWS config file

Description

Enable script to read from config file to allow user to determine which account/environment to run it in .

Expected Behavior

When environment specified then it will run in that AWS account.

 $ rds clone --environment Dev

Actual Behavior

Currently have to set up environment variable with AWS_PROFILE

Possible Fix

Use click-configfile module.

Your Environment

Include as many relevant details about the environment you experienced the bug in

  • Version used: 1.0
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): Python 2.7
  • Server type and version: MacBook 2015
  • Operating System and version: MacOS Sierra 10.13.2

Print output in column

Description

When printing detailed output then should provide in column output.

Possible Fix

Use click-tools-column module.

Your Environment

Include as many relevant details about the environment you experienced the bug in

  • Version used: 1.0
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): Python 2.7
  • Server type and version: MacBook 2016
  • Operating System and version: MacOS Sierra 10.13.2

Provide list RDS instance/cluster IDs

Description

When cloning or restoring without specifying instance/snapshot ID, then the script should print a list of available clusters/instances/snapshots to choose.

Expected Behavior

See Above.

Actual Behavior

Currently have to add in user input.

Possible Fix

Not Sure yet

Your Environment

Include as many relevant details about the environment you experienced the bug in

  • Version used: 1.0
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): Python 2.7
  • Server type and version: MacBook 2016
  • Operating System and version: MacOS Sierra 10.13.2

User to specify date of snapshot

Description

Provide the ability for the user to choose snapshot by date for restore.

Expected Behavior

$ rds restore --date 2017-11-10

Actual Behavior

Currently fetches the latest only.

Possible Fix

Use click-datetime module.

Your Environment

  • Version used: 1.0
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): Python 2.7
  • Server type and version: MacBook 2015
  • Operating System and version: MacOS Sierra 10.13.2

Coloured Output

Description

Provide different colour codes in stdout. Green for success and red for error.

Expected Behavior

Any error should print red and bold.

Actual Behavior

Tell us what happens instead

Possible Fix

Use Crayons module for colored output.

Your Environment

  • Version used: 1.0
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): Python 2.7
  • Server type and version: NA
  • Operating System and version: MacOS Sierra 10.13.2

Add a didyoumean feature

Description

Add a did you mean feature to capture typos.

Expected Behavior

Type in an ambiguous and it presents you relevant options.

Actual Behavior

Provides an error.

Possible Fix

Use the python click-didyoumean module

Your Environment

  • Version used: 1.0
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): Python 2.7
  • Server type and version: NA
  • Operating System and version: MacOS Sierra 10.13.2

Display progress bar during wait.

Description

When instances are created in the background; a progress bar or spinner will ensure the user isn't in doubt of any error.

Expected Behavior

When running the script there should be a spinning bar.

Possible Fix

Use Click-spinner module.

Your Environment

  • Version used: 1.0
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): Python 2.7
  • Server type and version: NA
  • Operating System and version: MacOS Sierra 10.13.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.