Code Monkey home page Code Monkey logo

aws_helper's Introduction

aws_helper

Gem Version Gem Downloads Build Status

Aws Helper for an instance

Allows functions on EBS volumes, snapshots, IP addresses and more

  • initially snapshots are supported

Installation

Add this line to your application's Gemfile:

gem 'aws_helper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install aws_helper

Minimal Usage

Assuming server start with an IAM role that have read access to AWS can create and delete snapshots:

Snapshot EBS root device at /dev/sda1

aws_helper snap /dev/sda1 --description zzzzzzzzz

Prune so only keep 7 snapshots:

aws_helper snap_prune /dev/sda1 --snapshots_to_keep=7

Email me a list of the latest 20 snapshots:

aws_helper snap_email [email protected] [email protected] mysmtpemailserver.com

Cleanup ebs disks - Delete old server root disks:

aws_helper ebs_cleanup

Disks that are 8GB in size, not attached to a server, not tagged in any way and from a snapshot will be deleted.     

Complex Usage

If your server does not have a role then you need to code the AWS keys which is not best practice:

Snapshot EBS attached to device /dev/sdf volume vol-123456 access AWS through an http proxy:

export AWS_ACCESS_KEY_ID ='xxxxxxxxxxxx'
export AWS_SECRET_ACCESS_KEY ='yyyyyyyy'
export HTTP_PROXY=http://myproxy:port
aws_helper snap /dev/sdf vol-123456 --description zzzzzzzzz

Prune so only keep 20 snapshots:

export AWS_ACCESS_KEY_ID ='xxxxxxxxxxxx'
export AWS_SECRET_ACCESS_KEY ='yyyyyyyy'
export HTTP_PROXY=http://myproxy:port
aws_helper snap_prune /dev/sdf vol-123456 --snapshots_to_keep=20

Email me a list of the latest 30 snapshots with a subject title on email:

export AWS_ACCESS_KEY_ID ='xxxxxxxxxxxx'
export AWS_SECRET_ACCESS_KEY ='yyyyyyyy'
export HTTP_PROXY=http://myproxy:port
aws_helper snap_email [email protected] [email protected] mysmtpemailserver.com 'My EBS Backups' --rows=30

Other functions to follow

aws_helper's People

Contributors

neillturner avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

dainedanielson

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.