GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - C2FO/lambda-ebs-backup: Lambda function for periodic backup of ebs volumes and creating AMIs

This repository was archived by the owner on Apr 9, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

39 Commits
39 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
cloudformation
cloudformation
 
 
cmd/lambda-ebs-backup
cmd/lambda-ebs-backup
 
 
pkg
pkg
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 

Repository files navigation

lambda-ebs-backup

Lambda EBS Backup uses labmda function to manage EBS snapshots on a user-defined schedule.

  • lambda-ebs-backup
    • Usage
      • Creating labmda-ebs-backup IAM Role
      • Uploading the code to S3
      • Creating the Lambda Function

Usage

Creating labmda-ebs-backup IAM Role

To create the lambda function which cmanages backups, first you must create the role which allows it to create backups. You can do this with:

make create-iam-role

If you have already created the IAM role and need to update it, you can do so by running:

make update-iam-role

Finally, capture the lambda role arn like so:

export LAMBDA_ROLE_ARN=$(make lambda-role-arn)

Uploading the code to S3

After you create the IAM role, you'll need to upload the code to S3 so it is available to the cloudformation to use for the lambda function. You can do so with:

export S3_LAMBDA_BUCKET="your-bucket"
export S3_LAMBDA_KEY="your-key.zip"
make lambda-zip
export S3_OBJECT_VERSION_ID=$(make version-id)

Now S3_OBJECT_VERSION_ID contains the version ID of the S3 object in S3 which contains your code.

Creating the Lambda Function

Finally, you can create the lambda function like so:

make create-lambda-ebs-backup

Tagging Volumes for backup

In order to backup a volume, you must opt-in by setting a tag key:value pair on the volume. By default, this is lambda-ebs-backup/backup:true. This tells the lambda function that we are to create a snapshot of the volume.

Controlling how many Volume Snapshots are kept

By default, only 2 volume snapshots are kept. You can override this globally by setting the environment variable DEFAULT_MAX_KEEP_SNAPSHOTS in the cloudformation for the lambda function. Alternatively, you can control this on a volume by volume basis by setting the following tag key:value pair on the volume: lambda-ebs-backup/max-keep-snapshots.

Tagging Images for AMI creation

In order to take an AMI of an instance, you must opt-in by setting a tag key:value pair on the instance. By default, this is lambda-ebs-backup/image:true. This tells the lambda function that we should create an AMI of this instance.

Controlling how many AMIs are kept

By default, only 2 AMIs are kept. You can override this globally by setting the environment variable DEFAULT_MAX_KEEP_IMAGES in the cloudformation for the lambda function. Alternatively, you can control this on an instance by instance basis by setting the following tag key:value pair on the instance: lambda-ebs-backup/max-keep-images.

Controlling reboot behvior for images.

By default, we will reboot the instance when creating an image of it. However, you might prefer that the instance does not reboot and wish to chance it on filesystem integrity. You can allow this by setting the tag key:value pair to lambda-ebs-backup/reboot-on-image:false on your instance.

About

Lambda function for periodic backup of ebs volumes and creating AMIs

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

7 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.