Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


aws-ec2-snapshot (2) Versions 1.0.0

Installs/Configures aws-ec2-snapshot

cookbook 'aws-ec2-snapshot', '= 1.0.0', :supermarket
cookbook 'aws-ec2-snapshot', '= 1.0.0'
knife supermarket install aws-ec2-snapshot
knife supermarket download aws-ec2-snapshot
Quality -%

aws-ec2-snapshot Cookbook

Chef cookbook for installing the aws-ec2-snapshot functionality on both Windows and Linux. This is based on the great set of scripts from Casey Labs and will be kept as in-sync as possible with their scripts to keep feature parity.

This can use either an instance IAM role or specified keys from an IAM user to handle the backups. It is, however, strongly recommended that an instance IAM role is used to provide proper security and reduce the risk of keys being exposed.

By default, snapshots are retained for 7 days before being deleted. This is configureable via the days_to_keep_snapshot attribute.


Cookbook Dependencies

  • awscli - Handles the AWS CLI installation.
  • windows - Needed for Windows things.


  • Centos 6.x
  • Centos 7.x
  • Amazon Linux
  • Windows 2012 R2
  • This likely works on other Linux distros and versions of Windows, but hasn't been officially tested



Determines the platform of the system and runs the appropriate recipe (Windows or Linux)


  • Creates the backerupper user.
  • Configures the AWS CLI tools with the backerupper AWS credentials only if not using an IAM instance role. Note that this is not determined dynamically, it's specified in the attributes of the node.
  • Drops in the bash script to handle the backups.
  • Creates a crontab entry for the backerupper user.


  • Installs the scripts for the backups to c:\ebs-snapshot.
  • If instance_uses_iam_role is false, the script will put the specified IAM keys in the powershell script so that it will run successfully.
  • Creates a scheduled task to run the backup. The scheduled task runs under the SYSTEM account and is scheduled to kick off at midnight server time.


  • node['aws-ec2-snapshot']['instance_uses_iam_role'] - Set to false if the server was not built with an IAM role that with the policies required. Defaults to true.
  • node['aws-ec2-snapshot']['aws_access_key_id'] - Specifies the AWS access key ID for the account with permissions. Not used if IAM role is set to true.
  • node['aws-ec2-snapshot']['aws_secret_access_key'] - Specifies the AWS secret access key for the account with permissions. Not used if IAM role is set to true.
  • node['aws-ec2-snapshot']['days_to_keep_snapshot'] - Specifies the number of days to keep the snapshot.
  • node['aws-ec2-snapshot']['region'] - The AWS region that the server is in. Not used if IAM role is set to true and is only used in the Linux recipe.


Include the aws-ec2-snapshot cookbook in your run list.

  "run_list": [

IAM Role Requirements

For this script to work you either need to have an instance IAM role with the following policy attached, or an IAM user with the following policy attached.

    "Version": "2012-10-17",
    "Statement": [
            "Sid": "Stmt1426256275000",
            "Effect": "Allow",
            "Action": [
            "Resource": [


This software is licensed under the GNU General Public License v2.0.

Dependent cookbooks

windows >= 1.37.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

aws-ec2-snapshot CHANGELOG


  • Jason Boeshart - Initial release of aws-ec2-snapshot

No quality metric results found