GithubHelp home page GithubHelp logo

tblong / aws-snapshot-tool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evannuil/aws-snapshot-tool

1.0 2.0 0.0 39 KB

A Python/Boto script that automates snapshot making of EBS volumes and rotating.

Python 100.00%

aws-snapshot-tool's Introduction

aws-snapshot-tool

aws-snapshot-tool is a python script for AWS Lambda to make it easy to roll snapshot of your EBS volumes.

Simply assign a tag for each volume that is to have snapshots, configure the aws-snapshot-tool config.sample and the AWS Lambda script is ready. Based of how many snapshots that is needed to keep and scheduling that is desired for AWS Lambda to execute the AWS Lambda code, it will handle rolling snapshots on any schedule so that setting up the retention policy is simple.

Features:

  • Python based: Leverages boto and is easy to configure and upload to AWS Lambda server
  • Simple tag system: Just add a tag to every EBS volume that need snapshots
  • Configure retention policy: Configure how many snapshots you want to retain
  • Optimized for AWS Lambda scheduling: Allows the scheduling to be set within AWS Lambda not the config.py file.
  • SNS Notifications: aws-snapshot-tool works with Amazon SNS out of the box, so notification of snapshots is available

Usage

  1. Create a project folder for all of the projects resources.
  2. Install the Boto package, by using pip, inside of the project folder(not Boto3) (see: Install:Pip Install:Boto)
  3. Place both the snapshots.py and config.sample inside of the project folder
  4. Rename config.sample file to config.py
  5. Create a SNS topic in AWS and copy the ARN into the config.py file
  6. Subscribe with a email address to the SNS topic to receive updates
  7. Create a snapshot user in IAM and put the key and secret in the config.py file
  8. Create a security policy for this user (see: iam.policy.sample)
  9. Decide how many versions of the snapshots you want and change this in the config.py file
  10. Change the Region and Endpoint for AWS in the config.py file
  11. Optionally specify a proxy if needed, otherwise set it to '' in the config.py file
  12. In the config.pyfile, specify the tags that are used to search Volumes and take snapshots
  13. For each Volume that is to have snapshots, give a Tag with a Key and a Value, and put this data in the config.py file. Default: "autosnap" and the value "true" and "Customer" and the value "Customer Name"
  14. Upon completion of configuring config.py, within the project folder, zip up all of the contents(makesnapshots.py, config.py, boto folder, and boto-2.38.0.dist-info folder) as one zip file
  15. Upload the zip file within the project folder to AWS Lambda
  16. Under the settings within AWS Lambda, configure the scheduling for the snapshots to be taken(see:Scheduled Events)

Additional Notes

The user that executes the script needs the following policies: see iam.policy.sample
This script is compatible with Boto, not Boto3
During step 14, the folder "boto-2.38.0.dist-info" may be a different version

aws-snapshot-tool's People

Contributors

cammanderson avatar evannuil avatar shupp avatar tblong avatar wojcikstefan avatar zacherytcox avatar

Stargazers

 avatar

Watchers

 avatar  avatar

aws-snapshot-tool's Issues

add support for multiple tags for snapshot criteria

Currently the only tag being searched for is tag_name. This poses a problem if a backup script will be running on two separate EC2 instances across two separate customers. Once the same script is installed on another customer's set of instances, the second backup script will invoke a snapshot of the first customer's instances since the same key-value pair criteria is used. Add flexibility to the config.sample and makesnapshots.py files where both a customer=name and autosnap=true key-value pairs must match before a snapshot is both taken and removed.

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.