rds-s3-backup 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,24 +1,70 @@
1
1
  # Rds::S3::Backup
2
2
 
3
- TODO: Write a gem description
3
+ The rds-s3-backup gem is a thor script that take a backup of an AWS RDS server and saves the mysqldump to an S3 bucket.
4
+ Then it runs an obfuscation SQL script and saves the mysqldump to another S3 bucket.
4
5
 
5
6
  ## Installation
6
7
 
7
- Add this line to your application's Gemfile:
8
+ This gem is intended for use in a Chef recipe, and can be installed in your cookbook's recipe default recipe file as:
8
9
 
9
- gem 'rds-s3-backup'
10
+ gem-package 'rds-s3-backup'
11
+ action :install
12
+ end
10
13
 
11
- And then execute:
14
+ It can be installed stand-alone as well via the usual:
12
15
 
13
- $ bundle
16
+ gem install rds-s3-backup
14
17
 
15
- Or install it yourself as:
18
+ ## Usage
16
19
 
17
- $ gem install rds-s3-backup
20
+ rds-s3-backup.rb s3-dump [options]
21
+
22
+ ## Options:
23
+ * `--rds-instance-id=RDS_INSTANCE_ID`
24
+ * `--s3-bucket=S3_BUCKET`
25
+ * `--backup-bucket=BACKUP_BUCKET`
26
+ * `--s3-prefix=S3_PREFIX`
27
+ * `--aws-access-key-id=AWS_ACCESS_KEY_ID`
28
+ * `--aws-secret-access-key=AWS_SECRET_ACCESS_KEY`
29
+ * `--mysql-database=MYSQL_DATABASE`
30
+ * `--mysql-username=MYSQL_USERNAME`
31
+ * `--mysql-password=MYSQL_PASSWORD`
32
+ * `--fog-timeout=FOG_TIMEOUT`
33
+ * `--obfuscate-sql=OBFUSCATE_SQL`
34
+ * `--dump-ttl=DUMP_TTL`
35
+ * `--dump-directory=DUMP_DIRECTORY`
36
+ * `--config-file=CONFIG_FILE`
37
+ * `--aws-region=AWS_REGION`
38
+ * `--aws-s3-region=AWS_S3_REGION`
39
+ * `--db-subnet-group-name=DB_SUBNET_GROUP_NAME`
40
+ * `--db-instance-type=DB_INSTANCE_TYPE`
41
+ * `--instance-id=INSTANCE_ID`
42
+ * `--log-level=LOG_LEVEL`
18
43
 
19
- ## Usage
44
+ ## Configuration File
45
+
46
+ The configuration file, specified by `--config-file` parameter is a YAML file with tags consisting of the option names without leading dashs, and internal dashes converted to underscores. Thus:
47
+
48
+ ~~~~~~
49
+ rds_instance_id: "RDS Instance ID"
50
+ db_subnet_group_name: "Subnet Group Name"
51
+ s3_bucket: "S3 bucket"
52
+ aws_access_key_id: "AWS KEY"
53
+ aws_secret_access_key: "AWS SECRET KEY"
54
+ mysql_database: "dbname"
55
+ mysql_username: "user"
56
+ mysql_password: "password"
57
+ dump_ttl: 0
58
+ data_dog_api_key: "DDOG API"
59
+ obfuscate_sql: "path/to/obfuscator/script.sql"
60
+ dump_directory: "path/to/local/directory/to/hold/dumps"
61
+ fog_timeout: 30*60
62
+ ~~~~~~
63
+
64
+ and so on.
65
+
66
+ Configuration file setting will override programmed defaults, and command line options will override configuration file settings.
20
67
 
21
- TODO: Write usage instructions here
22
68
 
23
69
  ## Contributing
24
70
 
@@ -37,7 +37,7 @@ class RdsS3Backup < Thor
37
37
  method_option :fog_timeout, :desc => 'Timeout in seconds for Fog requests (AWS connector)'
38
38
  method_option :obfuscate_sql, :desc => 'Obfuscation Stored Procedure source'
39
39
  method_option :dump_ttl, :desc => "Number of old dumps to keep."
40
- method_option :dump_directory => "Where to store the temporary sql dump file."
40
+ method_option :dump_directory, :desc => "Where to store the temporary sql dump file."
41
41
  method_option :config_file, :desc => "YAML file of defaults for any option. Options given during execution override these."
42
42
  method_option :aws_region, :desc => "Region of your RDS server (and S3 storage, unless aws-s3-region is specified)."
43
43
  method_option :aws_s3_region, :desc => "Region to store your S3 dumpfiles, if different from the RDS region"
@@ -42,7 +42,7 @@ module Rds
42
42
  $logger.level = set_logger_level(@options["log_level"])
43
43
 
44
44
  $dogger = DataDog.new(@options['data_dog_api_key'])
45
-
45
+
46
46
  "Starting RDS-S3-Backup at #{@options['timestamp']}".tap do |t|
47
47
  $logger.info t
48
48
  $dogger.send t
@@ -24,6 +24,7 @@ module Rds
24
24
  end
25
25
 
26
26
  def make_dog_client()
27
+ return unless @api_key
27
28
  begin
28
29
  Dogapi::Client.new(@api_key)
29
30
  rescue Exception => e
@@ -35,7 +36,7 @@ module Rds
35
36
 
36
37
 
37
38
  def send(msg, o={})
38
- return # do nothing for testing
39
+ return unless @api_key
39
40
 
40
41
  return if msg.nil? || msg.empty?
41
42
 
@@ -1,7 +1,7 @@
1
1
  module Rds
2
2
  module S3
3
3
  module Backup
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
  end
7
7
  end
@@ -7,9 +7,9 @@ Gem::Specification.new do |gem|
7
7
  gem.version = Rds::S3::Backup::VERSION
8
8
  gem.authors = ["Tamara Temple"]
9
9
  gem.email = ["tamouse@gmail.com"]
10
- gem.description = %q{"Backup from AWS RDS snapshot to AWS S3 as mysqldump"}
10
+ gem.description = %q{"Thor script and libraries to backup an AWS RDS snapshot to AWS S3, and create an obfustacted version to backup on S3 as well"}
11
11
  gem.summary = %q{"Backup from AWS RDS snapshot to AWS S3 as mysqldump"}
12
- gem.homepage = ""
12
+ gem.homepage = "https://github.com/novu/rds-s3-backup-gem"
13
13
 
14
14
  gem.files = `git ls-files`.split($/)
15
15
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rds-s3-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-02 00:00:00.000000000 Z
12
+ date: 2013-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -155,7 +155,8 @@ dependencies:
155
155
  - - ! '>='
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
- description: ! '"Backup from AWS RDS snapshot to AWS S3 as mysqldump"'
158
+ description: ! '"Thor script and libraries to backup an AWS RDS snapshot to AWS S3,
159
+ and create an obfustacted version to backup on S3 as well"'
159
160
  email:
160
161
  - tamouse@gmail.com
161
162
  executables:
@@ -183,7 +184,7 @@ files:
183
184
  - test_data/.gitignore
184
185
  - test_data/sample-config.yml
185
186
  - test_output/.gitkeep
186
- homepage: ''
187
+ homepage: https://github.com/novu/rds-s3-backup-gem
187
188
  licenses: []
188
189
  post_install_message:
189
190
  rdoc_options: []