All Projects → osiegmar → aws-lambda-backup

osiegmar / aws-lambda-backup

Licence: Apache-2.0 License
AWS Lambda script to create and remove snapshots of EBS volumes.

Programming Languages

python
139335 projects - #7 most used programming language
HCL
1544 projects

Projects that are alternatives of or similar to aws-lambda-backup

aws-lambda-ebs-backups
Python scripts to be run using AWS's Lambda service to Backup and Delete Snapshots of EBS Volumes
Stars: ✭ 31 (-20.51%)
Mutual labels:  aws-lambda, backup-script, ebs-volumes
shelvery-aws-backups
Automating EBS RDS EC2 backups on lambda
Stars: ✭ 31 (-20.51%)
Mutual labels:  ebs-volumes, ebs-snapshots
polyfill-lambda
Generates polyfills based on user agent strings
Stars: ✭ 83 (+112.82%)
Mutual labels:  aws-lambda
libvips-lambda
libvips Executable for AWS Lambda
Stars: ✭ 43 (+10.26%)
Mutual labels:  aws-lambda
backend
Easily host entire web applications on a single AWS Lambda function using Serverless Components
Stars: ✭ 16 (-58.97%)
Mutual labels:  aws-lambda
minecraft-lambda-function
AWS Lambda function for managing Minecraft server
Stars: ✭ 37 (-5.13%)
Mutual labels:  aws-lambda
chalice-extended-action
Automated deployment of your Chalice application via Github Actions
Stars: ✭ 18 (-53.85%)
Mutual labels:  aws-lambda
lando
📦 🚀 a smooth-talking smuggler of Rust HTTP functions into AWS lambda
Stars: ✭ 68 (+74.36%)
Mutual labels:  aws-lambda
faas-federation
Enable routing between multiple OpenFaaS gateways or providers
Stars: ✭ 18 (-53.85%)
Mutual labels:  aws-lambda
redis-examples
Sample applications implemented with serverless Redis
Stars: ✭ 44 (+12.82%)
Mutual labels:  aws-lambda
nightcoreify
Randomly generates nightcore and uploads it to YouTube. A joke that got out of hand.
Stars: ✭ 54 (+38.46%)
Mutual labels:  aws-lambda
aws-appsync-session-manager
AWS AppSync Session Manager - a sample AppSync project
Stars: ✭ 18 (-53.85%)
Mutual labels:  aws-lambda
twitter-bot-python-aws-lambda
A simple twitter bot using Python and an AWS Lambda function
Stars: ✭ 23 (-41.03%)
Mutual labels:  aws-lambda
python-serverless-api
Boilerplate flask app that is portable between different serverless platforms (AWS, Azure, GCP).
Stars: ✭ 19 (-51.28%)
Mutual labels:  aws-lambda
splunk handler
Python logging handler for sending logs to Splunk Enterprise
Stars: ✭ 44 (+12.82%)
Mutual labels:  aws-lambda
Network-Attached-Storage-NAS-Box-using-Raspberry-Pi
Network Attached Storage (NAS) Box using Raspberry Pi allows you to install comprehensive applications and services on your Raspberry Pi, whenever you need them.
Stars: ✭ 19 (-51.28%)
Mutual labels:  backup-script
aws-lambda-edge-basic-auth-terraform
A Terraform module that creates AWS Lambda@Edge resources to protect CloudFront distributions with Basic Authentication.
Stars: ✭ 18 (-53.85%)
Mutual labels:  aws-lambda
WebServerCloudBackups
Automatic backups your web projects bases and files to the clouds via WebDAV.
Stars: ✭ 20 (-48.72%)
Mutual labels:  backup-script
Prisma-Enhanced-Remediation
Create custom auto-remediation solutions using serverless functions in the cloud.
Stars: ✭ 31 (-20.51%)
Mutual labels:  aws-lambda
aws lambda deploy
Automated AWS Lambda Deployment (Python)
Stars: ✭ 40 (+2.56%)
Mutual labels:  aws-lambda

AWS Lambda Backup

AWS Lambda Backup is a script to create and remove snapshots of EBS volumes.

Features

  • Create daily, weekly, monthly and yearly snapshots based on your individual configuration
  • Automatically clean up old snapshots

Configuration

Just add a Tag named LambdaBackupConfiguration to your EC2 instances with the following format:

[RetentionDaily],[RetentionWeekly],[RetentionMonthly],[RetentionYearly]

Examples:

  • 7,4,12,1 to have 7 daily, 4 weekly, 12 monthly and 1 yearly backup
  • 7,0,3,0 to have 7 daily, 3 monthly backups
  • 0,4,0,0 to have 4 weekly backups

Only one backup per day will be created (due to parallel snapshot limitations of AWS). Weekly backups will be created on Sunday, monthly backups on 1st day of the month and yearly backups on 1st of January. If you specify 0 for a weekly, monthly or yearly Retention, a backup for the next group (monthly instead of yearly, weekly instead of monthly and daily instead of weekly) will be made.

Installation

Via Terraform

This project is a Terraform module. Reference module by adding the following to your terraform configuration:

module "aws-lambda-backup" {
  source  = "${path-to-modules}/aws-lambda-backup"
}

Initialize module by (re-)initializing your terraform project:

terraform init

Apply changes to terraform configuration:

terraform plan -out terraform.tfplan

Check if everything is ok and then call:

terraform apply terraform.tfplan

Via CloudFormation

TBD

Manually

  1. Create an IAM role for AWS Lambda and add the following inline policy:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents",
                "ec2:CreateSnapshot",
                "ec2:CreateTags",
                "ec2:DeleteSnapshot",
                "ec2:DescribeInstances",
                "ec2:DescribeSnapshots"
            ],
            "Resource": "*"
        }
    ]
}
  1. Create a Lambda function
  • Select blueprint
    • Select "Blank Function"
  • Configure triggers
    • Select "CloudWatch Events - Schedule"
    • Choose "rate(1 day)"
    • Enable trigger
  • Configure function
    • Enter name
    • Select "Python 3.6" from the Runtime dropdown
    • Copy the source code from ebs-backup.py to code window
    • Check that Handler is "lambda_function.lambda_handler"
    • Choose the previously created IAM role
  1. Check the logs

Check the logs in the CloudWatch Logs area.

Copyright

Copyright 2017 Oliver Siegmar

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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].