<commit_before>= Description
Creates a snapshot of each EBS volume attached to the list of instances provided in aws_snapshotter_settings (or all instances if an empty array is provided)

Each instance is stopped, to ensure that the snapshot will contain consistent data.

Snapshot history is deleted based on the "snapshots_to_keep" value in the settings file.  This specifies how many backup snapshots should be kept for each EBS volume on each instance specified.

An aws_snapshotter_settings.rb.example file is provided, to configure the aws_snapshotter just...

  $ cp aws_snapshotter_settings.rb.example aws_snapshotter_settings.rb

Then change the values to include your AWS credentials, and the list of instances you want to create snapshots for.  Easy!

== Install Directions
The AWS Snapshotter currently depends upon a build of the right_http_connection and right_aws gems which is not available in gem source.  You must install them manually, specifying a source, like so.

  $ wget http://rgeyer.s3.amazonaws.com/gems/right_http_connection-1.3.0.gem
  $ wget http://rgeyer.s3.amazonaws.com/gems/right_aws-2.1.0.gem
  $ gem install right_http_connection-1.3.0.gem
  $ gem install right_aws-2.1.0.gem

There is an _iampolicy.json_ document included in the repository.  This is intended to be used with Amazon's Identity and Access Management {(IAM)}[http://aws.amazon.com/iam/]

To apply this policy follow the "Get Tools" directions {here}[http://docs.amazonwebservices.com/IAM/latest/GettingStartedGuide/], then run the following commands.  This assumes that all of the iam binaries are accessible in your PATH environment variable, and that you're PWD is the directory which contains aws_snapshotter

  $ iam-groupcreate -g AWSSnapshotter -v
  $ iam-groupuploadpolicy -g AWSSnapshotter -f ./iam_policy.json -p SnapshotterActions
  $ iam-usercreate -g AWSSnapshotter -k -u aws_snapshotter -v

The first and second line of the response of iam-usercreate are the AWS Access Key ID and AWS Secret Access Key which are needed in your settings file.

== Running aws_snapshotter
Once you've created the IAM user and configured your aws_snapshotter_settings file, you can run the AWS Snapshotter with this simple command.

  $ ruby create_snaps.rb

== Assumptions & Prerequisites
The AWS Snapshotter is designed to take periodic snapshots of running EC2 instances.  The following assumptions are made about the instances defined in the _Settings::instances_ directive of the settings file (or all instances for your account, if _Settings::instances_ is left empty).

* The instances are EBS backed, and can be stopped/started
* The instances are in the "running" state when the AWS Snapshotter is run

In order to ensure data integrity of the snapshots which are created, the running instances are first stopped so that I/O to the EBS volumes is halted.  The snapshot request is issued only after AWS Snapshotter verifies that the instance is stopped, and the instances are immediately restarted after the snapshot request is made.

If an instance is stopped when the AWS Snapshotter is executed, no snapshot will be made for the EBS volumes attached to it, even if the instance is listed in the _Settings::instances_ directive.

= TODO
* More error handling
  * It's okay if stopping and snapshotting instances fail, it's not okay if the instances are never restarted.
* Enhancements
  * Maybe it's okay to take snapshots for instances that are listed and are already in the stopped state?<commit_msg>Update README regarding retirement status<commit_after>= aws_snapshotter

Creates a snapshot of each EBS volume attached to the list of instances provided in aws_snapshotter_settings (or all instances if an empty array is provided).

== Status

{Unsupported}[http://labs.cityindex.com/wp-content/uploads/2012/01/lbl-unsupported.png]

This project has been retired and is no longer being supported by City Index Ltd.

* if you should choose to fork it outside of City Index, please let us know so we can link to your project

== Description

Creates a snapshot of each EBS volume attached to the list of instances provided in aws_snapshotter_settings (or all instances if an empty array is provided).

Each instance is stopped, to ensure that the snapshot will contain consistent data.

Snapshot history is deleted based on the "snapshots_to_keep" value in the settings file.  This specifies how many backup snapshots should be kept for each EBS volume on each instance specified.

An aws_snapshotter_settings.rb.example file is provided, to configure the aws_snapshotter just...

  $ cp aws_snapshotter_settings.rb.example aws_snapshotter_settings.rb

Then change the values to include your AWS credentials, and the list of instances you want to create snapshots for.  Easy!

=== Install Directions
The AWS Snapshotter currently depends upon a build of the right_http_connection and right_aws gems which is not available in gem source.  You must install them manually, specifying a source, like so.

  $ wget http://rgeyer.s3.amazonaws.com/gems/right_http_connection-1.3.0.gem
  $ wget http://rgeyer.s3.amazonaws.com/gems/right_aws-2.1.0.gem
  $ gem install right_http_connection-1.3.0.gem
  $ gem install right_aws-2.1.0.gem

There is an _iampolicy.json_ document included in the repository.  This is intended to be used with Amazon's Identity and Access Management {(IAM)}[http://aws.amazon.com/iam/]

To apply this policy follow the "Get Tools" directions {here}[http://docs.amazonwebservices.com/IAM/latest/GettingStartedGuide/], then run the following commands.  This assumes that all of the iam binaries are accessible in your PATH environment variable, and that you're PWD is the directory which contains aws_snapshotter

  $ iam-groupcreate -g AWSSnapshotter -v
  $ iam-groupuploadpolicy -g AWSSnapshotter -f ./iam_policy.json -p SnapshotterActions
  $ iam-usercreate -g AWSSnapshotter -k -u aws_snapshotter -v

The first and second line of the response of iam-usercreate are the AWS Access Key ID and AWS Secret Access Key which are needed in your settings file.

=== Running aws_snapshotter
Once you've created the IAM user and configured your aws_snapshotter_settings file, you can run the AWS Snapshotter with this simple command.

  $ ruby create_snaps.rb

=== Assumptions & Prerequisites
The AWS Snapshotter is designed to take periodic snapshots of running EC2 instances.  The following assumptions are made about the instances defined in the _Settings::instances_ directive of the settings file (or all instances for your account, if _Settings::instances_ is left empty).

* The instances are EBS backed, and can be stopped/started
* The instances are in the "running" state when the AWS Snapshotter is run

In order to ensure data integrity of the snapshots which are created, the running instances are first stopped so that I/O to the EBS volumes is halted.  The snapshot request is issued only after AWS Snapshotter verifies that the instance is stopped, and the instances are immediately restarted after the snapshot request is made.

If an instance is stopped when the AWS Snapshotter is executed, no snapshot will be made for the EBS volumes attached to it, even if the instance is listed in the _Settings::instances_ directive.

== TODO
* More error handling
  * It's okay if stopping and snapshotting instances fail, it's not okay if the instances are never restarted.
* Enhancements
  * Maybe it's okay to take snapshots for instances that are listed and are already in the stopped state?
  
== License

Copyright 2011 City Index Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

{http://www.apache.org/licenses/LICENSE-2.0}[http://www.apache.org/licenses/LICENSE-2.0]

Unless required by applicable law or agreed to in writing, software
distributed under the License 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.
{'fraction_non_alphanumeric': 0.05015982296533071, 'fraction_numerical': 0.005655274157855913, 'mean_word_length': 4.571917808219178, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3158738', 'n_tokens_mistral': 2153, 'n_tokens_neox': 2120, 'n_words': 1096}