Lambda function to automatically back up your Lightsail instances.
Switch branches/tags
Nothing to show
Clone or download
jpignata Merge pull request #12 from leozhad/master
added CLI named profile support
Latest commit 9882d15 Apr 20, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin added CLI named profile support Apr 18, 2018
deploy Initial commmit Jan 5, 2017
lambda Use boto3 paginators Mar 26, 2017
tests Add assertion for client factory Jan 22, 2017
.gitignore Add test coverage Jan 22, 2017
LICENSE Initial commmit Jan 5, 2017
README.md Parameterize event schedule Dec 30, 2017
lightsail-auto-snapshots.yaml Parameterize event schedule Dec 30, 2017

README.md

Lightsail Auto Snapshots

An AWS Lambda function to automatically snapshot all Amazon Lightsail virtual private servers in an account and retain them for a given number of days. The included AWS Serverless Application Model (SAM) template will upload and create the function, grant it the permissions necessary to list your Lightsail instances and snapshots and create and delete snapshots, and schedule it to run once per day.

Usage

To install this function, ensure you have the AWS Command Line Interface (AWS CLI) installed and configured.

Run the deploy script and optionally specify the region to install the function and the number of days for which snapshots should be retained. By default, the script will install the function into your default configured region and retain snapshots for 30 days.

## Install in US East (Ohio) and retain snapshots for 15 days
REGION=us-east-2 DAYS=15 bin/deploy

## Install in the CLI's configured default region and retain snapshots for 90 days
DAYS=90 bin/deploy

## Install in EU (Ireland) and retain snapshots for 30 days
REGION=eu-west-1 bin/deploy

## Install in Asia Pacific (Tokyo) and create snapshot every day at 7:00pm UTC, retain snapshots for 30 days
REGION=ap-northeast-1 SCHEDULE="cron(0 19 * * ? *)" bin/deploy

License

Copyright 2011-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file 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.