Browse the Repo
Browse the Repo
Snapshot your EC2 instances on a scheduled basis.
This module can be used to make scheduled backups of an EC2 Instance and its EBS Volumes. Under the hood, this module uses package-lambda to deploy a Lambda function that is triggered on a scheduled basis by Amazon CloudWatch Events and runs ec2-snapper to take a snapshot of the EC2 Instance.
To specify the instance to backup, you simply provide the instance's name via the
instance_name parameter. This
should correspond to a tag on your EC2 Instance
with the name
You can specify how often this lambda function runs using the
backup_job_schedule_expression parameter. This can
be either a rate expression such as
rate(1 day) or a cron expression such as
cron(0 20 * * ? *). See Schedule
Expressions for more information and
Every time the function runs successfully, it will increment a CloudWatch Metric. We've configured a CloudWatch alarm to go off if the metric is not updated on the expected schedule, as that implies the backup has failed to run!
You can specify the metric namespace and name using the
parameters, respectively. You can specify the SNS topic to notify when the alarm goes off using the
To prevent the number of snapshots from growing infinitely and costing you a lot of money,
automatically delete older snapshots. You can specify two parameters to control how many snapshots are kept around:
delete_older_than: Delete all snapshots older than this duration. For example, if you set this parameter to
then snapshots that are more than 30 days old will be deleted. See Delete AMIs older
than for more info.
require_at_least: Always keep around at least this many snapshots. This helps avoid deleting too much if you have,
for example, a misconfiguration of the
We're here to talk about our services, answer any questions, give advice, or just to chat.