Forge Home

ec2_snapshot

Puppet module to automate AWS EC2 snapshots

6,212 downloads

6,071 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.2 (latest)
  • 0.0.1
released Jun 27th 2016
This version is compatible with:

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'smithyuk-ec2_snapshot', '0.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add smithyuk-ec2_snapshot
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install smithyuk-ec2_snapshot --version 0.0.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

smithyuk/ec2_snapshot — version 0.0.2 Jun 27th 2016

ec2_snapshot for Puppet

This module will automate AWS EC2 snapshots via colinbjohnson's aws-missing-tools project and cron. Currently the module does not place credentials for AWS as I have another module to do this for me. It requires vcsrepo module.

EBS volumes tagged with the configured key/value in EC2 will be backed up (by default Backup=true).

Example usage

class { 'ec2_snapshot':
  region     => 'us-west-2',
  extra_opts => ['-n'],
  mailto     => 'root@localhost',
}

TODO

  • Configurable cron time for backup
  • Configurable user/group
  • Ability to place credentials with module (possibly with hiera-eyaml-gpg or other)

Notes

I would recommend creating a user specifically to handle backups and placing the relevant credentials in the ec2_snapshot user's ~/.aws/credentials file.

Here is an example of the IAM policy for the user:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:Describe*",
                "ec2:CreateSnapshot",
                "ec2:DeleteSnapshot"
            ],
            "Resource": "*"
        }
    ]
}