Giter Site home page Giter Site logo

bathomas / ec2-ami-automation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donbale/ec2-ami-automation

0.0 0.0 0.0 18 KB

Two scripts to add to your crontab. 1) Creates a full amazon machine image from a currently running instance. 2) Deregisters all amazon images that are older than a date D and then deletes all snapshots that are older than D (Amazon charges you for storage of snapshots, so you want to clean these up. There is no charge for having AMI's but they must be deregistered before deleting their associated snapshots)

Shell 100.00%

ec2-ami-automation's Introduction

ec2-ami-automation

-Two scripts to add to your crontab.

  1. ec2-create-image.sh: Creates a full amazon machine image from a currently running instance.
  2. del-snapshots.sh: Deregisters all amazon images that are older than a date D and then deletes all snapshots that are older than D (Amazon charges you for storage of snapshots, so you want to clean these up. There is no charge for having AMI's but they must be deregistered before deleting their associated snapshots)

Notes

  • To use this script you must have the AWS CLI installed on the device that will run the script: https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-linux.html and configured: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html

  • For del-snapshots.sh, you must have you account number for the owners parameter. From the aws console, select support center from the top right corner of the dashboard. When the page loads, your account number/owner id will be at the top of the page.

  • If you are not using an ubuntu os you may need to change your use of date to: __PASTDUE=$(date -v -3d "+%Y-%m-%d").

  • Change '3d' to whatever length of time you want. If you can afford to keep snapshots associated with 10 Amazon machine images, then change to __PASTDUE=$(date -v -10d "+%Y-%m-%d"); or __PASTDUE=$(date --date="10 days ago" +"%Y-%m-%d"), for ubuntu.

ec2-ami-automation's People

Contributors

tln8679 avatar

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.