Giter VIP home page Giter VIP logo

aws-scripts's Introduction

Documentation

As of majority cases, documentation is poor or missing.

Requirements:

  • In order to get it working, EC2 should be tagged with backupEnabled tag which has value yes || Yes || YES

  • retention tag should have integer value how long backups are preserved

  • Create IAM policy and attach policy to Role. Policy must have next values:

  • DescribeInstances

  • CreateSnapshot

  • CreateSnapshots

  • CreateTags

  • DescribeSnapshots

  • DeleteSnapshot

Create Lambda:

  • pick Author from scratch on right upper side
  • give it a name
  • and choose previously created role
  • select Python 2.7 interpreter and paste ebsSnapshot.py content. Please, copy it from RAW page to be sure you will not have issues with execution.
  • increase timeout to 3 mins
  • add environment variables
  • name: region
  • value: eg. us-east-1
  • only for ebsCleanup function add account_id environment variable with account id of your account
  • click on Triggers
  • add new trigger clicking on CloudWatch Events
  • select schedule and set up cron expression, eg. 0 12 * * ? *

Repeat the process for deleting snapshots with DeleteOn flag.

Note:

Additionally, you can set SNS to send notification whenever Lambda reported an error. With CloudWatch you can create dashboard with Invocations, Duration, Throttles and Errors.

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.