All Projects → manojlds → ebs-snapshot-lambda

manojlds / ebs-snapshot-lambda

Licence: Apache-2.0 license
AWS lambda function to snapshot EBS volumes and purge old snapshots.

Programming Languages

javascript
184084 projects - #8 most used programming language
HCL
1544 projects
shell
77523 projects

Projects that are alternatives of or similar to ebs-snapshot-lambda

ebs-backup
Backup EBS Volumes
Stars: ✭ 34 (-8.11%)
Mutual labels:  lambda, ebs-volumes, aws-ebs
aws-backup-lambda
A utility AWS lambda function to manage EBS and RDS snapshot backups.
Stars: ✭ 60 (+62.16%)
Mutual labels:  lambda, snapshot
terraform-aws-efs-backup
Terraform module designed to easily backup EFS filesystems to S3 using DataPipeline
Stars: ✭ 40 (+8.11%)
Mutual labels:  lambda, snapshot
shelvery-aws-backups
Automating EBS RDS EC2 backups on lambda
Stars: ✭ 31 (-16.22%)
Mutual labels:  lambda, ebs-volumes
Hands-On-Serverless-Applications-with-Go
Hands-On Serverless Applications with Go, published by Packt.
Stars: ✭ 92 (+148.65%)
Mutual labels:  lambda
aws-lambda-scheduler
aws-lambda-scheduler is EventBridge Rule manager that lets you call any existing AWS Lambda Function you have in a set future time with pre-set parameters. Allows more rule creation than AWS limit.
Stars: ✭ 58 (+56.76%)
Mutual labels:  lambda
docker-selenium-lambda
The simplest demo of chrome automation by python and selenium in AWS Lambda
Stars: ✭ 172 (+364.86%)
Mutual labels:  lambda
yake
A Rake-like DSL for writing AWS Lambda handlers
Stars: ✭ 146 (+294.59%)
Mutual labels:  lambda
BaNG
Backup Next Generation for Linux & Mac using rsync (support hardlinks and btrfs snapshots), Web-Frontend, Statistics, History-Merger)
Stars: ✭ 28 (-24.32%)
Mutual labels:  snapshot
serverless-lumigo-plugin
Serverless monitoring and troubleshooting plugin to easily apply distributed tracing
Stars: ✭ 59 (+59.46%)
Mutual labels:  lambda
leaderboard-app
GitHub leaderboard for your organisation or repo (Serverless SPA)
Stars: ✭ 64 (+72.97%)
Mutual labels:  lambda
website-honestly
🦄 The Red Badger website. Honestly.
Stars: ✭ 26 (-29.73%)
Mutual labels:  lambda
netlify-lambda-function-example
An example Netlify Lambda function that processes payments with Stripe.
Stars: ✭ 93 (+151.35%)
Mutual labels:  lambda
terraform-aws-lambda-function
A Terraform module for deploying and managing Lambda functions on Amazon Web Services (AWS). https://aws.amazon.com/lambda/
Stars: ✭ 37 (+0%)
Mutual labels:  lambda
aws-is-how
Know How Guide and Hands on Guide for AWS
Stars: ✭ 27 (-27.03%)
Mutual labels:  lambda
workshop-serverless-graphql
[AWSKRUG Serverless Group 2019] Serverless GraphQL Workshop
Stars: ✭ 80 (+116.22%)
Mutual labels:  lambda
go-localstack
Go Wrapper for using localstack
Stars: ✭ 56 (+51.35%)
Mutual labels:  lambda
video-snapshot
Get snapshots from a video file in the browser 🎥 🌅
Stars: ✭ 63 (+70.27%)
Mutual labels:  snapshot
xdagj
XDAGJ is an implementation of XDAG in Java. https://xdag.io
Stars: ✭ 81 (+118.92%)
Mutual labels:  snapshot
lambdakiq
ActiveJob on SQS & Lambda
Stars: ✭ 131 (+254.05%)
Mutual labels:  lambda

ebs-snapshot-lambda

AWS lambda function to snapshot EBS volumes and purge old snapshots.

Requirements

The EBS volumes that are to be snapshotted need to be tagged with two keys:

  • Snapshot (required) - the presence of this key indicates that this EBS volume needs to be snapshotted when the lambda function runs. Ideally, the lambda function will be scheduled once a day.

  • Retention (optional) - the value of this tag specifies the number of days the snapshot has to be retained before it is purged. Any snapshot that is created is tagged with the date at which it should be deleted, based on this value. If this tag is not present, a defaultRetention value specified in lambda/config.json is used (default: 7 days).

Configuration

The lambda/config.json has the following configurations that can be modified as required:

  • defaultRetention - A volume that is marked to be snapshotted with the Snapshot tag can also have a Retention tag with the number of days its snapshots have to be retained before purge. If the Retention tag is not present, this value will be used.

  • copyVolumeTagsToSnapshot - If this is set to true, all the tags of the volume, except Snapshot and Retention, are copied over to the snapshot.

Installation

Manual

Once lambda/config.json has been edited as required, run npm install --production or yarn install --production from lambda/ and zip up the folder. The zip archive can then be deployed like any other lambda function.

Terraform

The repo also comes with terraform plans to setup and install the lambda function, along with the required schedules and IAM role/policy. Verify with terraform plan and deploy with terraform apply.

Using as a module

The terraform plans can also be used as a module within your existing terraform project. Add as a module with something like below:

module "ebs-backup" {
  source = "github.com/manojlds/ebs-snapshot-lambda//terraform"

  lambda_prepared_source_dir = "${path.root}/ebs-backup-temp/source"
  lambda_archive_path = "${path.root}/ebs-backup-temp/dist/ebs_snapshot_lambda.zip"
}

Limitations

The lambda has following limitations / assumptions / compromises. Happy to hear suggestions or PRs addressing these:

  • Will not work for large number of volumes. AWS API limits and Lambda runtime limits are not take into account yet. I plan to add a "bulk" version that can handle 10s or 100s of volumes.
  • Assumes that snapshot is taken once a day. The unit is days and not hours. Will not work correctly for taking snapshots for, say, every 6 hours - will purge all the snapshots at once after the retention days.
  • The lambda will create snapshots twice if it is triggered twice irrespective of whether snasphot was already taken for the day.

License

This is an open source project licensed under the Apache License, Version 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].