A Terraform module for creating a Lambda function and associated IAM role for creating and managing EBS snapshots and rotation.
The module makes heavy use of tagging, and required that EBS volumes and/or EC2 instances are creating with specific
tags based upon the defaults listed below or a custom set of tags.
Input Variables
---------------
-`min_retention_count` - Minimum number of EBS snapshots to retain. Defaults to 1.
-`default_retention_days` - Default number of days to retain EBS snapshots for. Defaults to 7 days.
-`snapshot_tag` - Tag to use to mark EBS volumes for snapshotting. Defaults to 'MakeSnapshot'.
-`retention_tag` - Tag to use to mark EBS volume for retention. Defaults to 'Retention'.
-`delete_tag` - Tag to use to allow Lamba to automatically delete old EBS snapshots. Defaults to 'AutoDelete'.
-`cloudwatch_schedule` - Schedule for Cloudwatch event to invoke Lambda EBS snapshot function. Defaults to `cron(0 1 ? * * *)` which is every day at 01:00.
Outputs
-------
None.
Usage
-----
You can use this module in your Terraform template with the following steps. All variables have defaults set so setting any variables is optional.
1.) Adding a module resource to your template, e.g. `main.tf`