Giter Site home page Giter Site logo

abhineetraj / aws-lambda-elasticsearch-snapshots Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mangoman888/aws-lambda-elasticsearch-snapshots

0.0 1.0 0.0 5 KB

A Lambda function to automate taking manual snapshots and storing them in S3

Python 45.95% Shell 54.05%

aws-lambda-elasticsearch-snapshots's Introduction

Elasticsearch Snapshots backup to S3

Purpose ES only keeps 14 days of automated snapshots. To archive more than this requires taking manual snapshots; see http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains-snapshots.html

This Lambda function takes a snapshot of all the indices on the target ES cluster and stores them in a Snapshot directory (S3). Ensure you have created a S3 bucket before attempting to deploy this Lambda.

It will create a IAM role with the relevant policies for the Lambda function, register the snapshot directory for the ES domain, build the lambda package, and either update (if the function already exists) or create a lambda function.

The function can be run via a schedule rule.

To schedule lambda functions use CloudWatch > Rules > Create rule > Schedule > Add target > Function

Get started

The deployment process is done through run.sh.

  • You need to export the variables mentioned in the setenv file to your shell before deploying.

  • You need to update es_snapshotbucket.json with the S3 bucket you intend to use for the Snapshots.

  • It assumes AWS eu-west-1 is the region (edit occurances if your ES Domain is not eu-west-1)

To check the snapshot has been created try curl -XGET 'https://my-es-domain-endpoint/_snapshot/my-s3-bucket/_all?pretty'. If you get an anonymous access error, check your ES domain access policy.

N.B. To restore snapshots see http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains-snapshots.html#es-managedomains-snapshot-restore

Try restoring to a test cluster first

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.