rds-rotate-db-snapshots 0.4.0 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/ci.yml +28 -0
- data/.github/workflows/codeql.yml +76 -0
- data/Gemfile +1 -1
- data/README.md +83 -0
- data/VERSION +1 -1
- data/rds-rotate-db-snapshots.gemspec +8 -6
- metadata +7 -5
- data/.travis.yml +0 -9
- data/README.rdoc +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a666ea612ccbf5f055bebe3df9ac6f8c303e8cd6c5e56f2b389828aa2ed08e9a
|
4
|
+
data.tar.gz: a75dbd3e2c5d9652700de2d1ec00d68ab93eda719a8c634f6edcf6843b431b74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c0f1b569236f25233329e26b5de932fd2ff876695db1f413e04cfd8833c9743cb2d3eb38115da783be95388c441252a691a10f2082e50df9f5686d4a770e1ae
|
7
|
+
data.tar.gz: d545f978528f5f176b6ce440fc42aec92d9ff07bb41a510cae1aae4834897e7a1c016f37645d35ae317fbbbaae168def57e18661bfe865b5f65801e790080d41
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "bundler" # See documentation for possible values
|
9
|
+
directory: "/" # Location of package manifests
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: "CI"
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: ["master"]
|
6
|
+
pull_request:
|
7
|
+
branches: ["master"]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-20.04
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby_version: [2.7, 3.0, 3.1, 'jruby']
|
15
|
+
steps:
|
16
|
+
- name: Checkout code
|
17
|
+
uses: actions/checkout@v3
|
18
|
+
- name: Install Ruby and gems
|
19
|
+
uses: ruby/setup-ruby@03b78bdda287ae04217ee12e4b64996630a03542 #v1.131.0
|
20
|
+
with:
|
21
|
+
bundler-cache: true
|
22
|
+
ruby-version: ${{ matrix.ruby_version }}
|
23
|
+
- name: Install Bundler
|
24
|
+
run: gem install bundler
|
25
|
+
- name: Bundle Install
|
26
|
+
run: bundle install
|
27
|
+
- name: Test
|
28
|
+
run: bundle exec rake test
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ "master" ]
|
17
|
+
pull_request:
|
18
|
+
# The branches below must be a subset of the branches above
|
19
|
+
branches: [ "master" ]
|
20
|
+
schedule:
|
21
|
+
- cron: '22 4 * * 2'
|
22
|
+
|
23
|
+
jobs:
|
24
|
+
analyze:
|
25
|
+
name: Analyze
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
permissions:
|
28
|
+
actions: read
|
29
|
+
contents: read
|
30
|
+
security-events: write
|
31
|
+
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
language: [ 'ruby' ]
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
37
|
+
# Use only 'java' to analyze code written in Java, Kotlin or both
|
38
|
+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
39
|
+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
40
|
+
|
41
|
+
steps:
|
42
|
+
- name: Checkout repository
|
43
|
+
uses: actions/checkout@v3
|
44
|
+
|
45
|
+
# Initializes the CodeQL tools for scanning.
|
46
|
+
- name: Initialize CodeQL
|
47
|
+
uses: github/codeql-action/init@v2
|
48
|
+
with:
|
49
|
+
languages: ${{ matrix.language }}
|
50
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
51
|
+
# By default, queries listed here will override any specified in a config file.
|
52
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
53
|
+
|
54
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
55
|
+
# queries: security-extended,security-and-quality
|
56
|
+
|
57
|
+
|
58
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
59
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
60
|
+
- name: Autobuild
|
61
|
+
uses: github/codeql-action/autobuild@v2
|
62
|
+
|
63
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
64
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
65
|
+
|
66
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
67
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
68
|
+
|
69
|
+
# - run: |
|
70
|
+
# echo "Run, Build Application using script"
|
71
|
+
# ./location_of_script_within_repo/buildscript.sh
|
72
|
+
|
73
|
+
- name: Perform CodeQL Analysis
|
74
|
+
uses: github/codeql-action/analyze@v2
|
75
|
+
with:
|
76
|
+
category: "/language:${{matrix.language}}"
|
data/Gemfile
CHANGED
data/README.md
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# rds-rotate-db-snapshots
|
2
|
+
|
3
|
+
[<img src="https://badge.fury.io/rb/rds-rotate-db-snapshots.svg" alt="Gem
|
4
|
+
Version" />](https://badge.fury.io/rb/rds-rotate-db-snapshots) [![CI](https://github.com/serg-kovalev/rds-rotate-db-snapshots/actions/workflows/ci.yml/badge.svg?query=branch%3Amaster+event%3Apush)](https://github.com/serg-kovalev/rds-rotate-db-snapshots/actions/workflows/ci.yml?query=branch%3Amaster+event%3Apush) [![CodeQL](https://github.com/serg-kovalev/rds-rotate-db-snapshots/actions/workflows/codeql.yml/badge.svg?query=branch%3Amaster+event%3Apush)](https://github.com/serg-kovalev/rds-rotate-db-snapshots/actions/workflows/codeql.yml?query=branch%3Amaster+event%3Apush)
|
5
|
+
|
6
|
+
Provides a simple way to rotate db snapshots in Amazon Relational Database
|
7
|
+
Service (RDS).
|
8
|
+
|
9
|
+
## Tested on Rubies
|
10
|
+
|
11
|
+
- 2.7
|
12
|
+
- 3.1
|
13
|
+
- 3.2
|
14
|
+
- jruby
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
Gem installation:
|
19
|
+
|
20
|
+
```bash
|
21
|
+
gem install rds-rotate-db-snapshots
|
22
|
+
```
|
23
|
+
|
24
|
+
Usage:
|
25
|
+
|
26
|
+
```bash
|
27
|
+
rds-rotate-db-snapshots [options] <db_indentifier>
|
28
|
+
```
|
29
|
+
|
30
|
+
Add this script to CRON (let's say it will run this script every X hours) and it will do the job well
|
31
|
+
|
32
|
+
```bash
|
33
|
+
#/usr/bin/bash
|
34
|
+
AWS_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx'
|
35
|
+
AWS_SECRET_ACCESS_KEY='yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
36
|
+
AWS_REGION='eu-west-1'
|
37
|
+
DESCRIPTION_PREFIX='automatic-backup-'
|
38
|
+
RDS_ROTATOR=/here/is/the/path/to/rds-rotate-db-snapshots
|
39
|
+
DB_NAME='db_name_here'
|
40
|
+
|
41
|
+
$RDS_ROTATOR --aws-region $AWS_REGION --aws-access-key $AWS_ACCESS_KEY --aws-secret-access-key $AWS_SECRET_ACCESS_KEY --pattern $DESCRIPTION_PREFIX --keep-hourly 24 --keep-daily 7 --keep-weekly 4 --keep-monthly 1 --keep-yearly 0 --create-snapshot $DESCRIPTION_PREFIX$DB_NAME $DB_NAME
|
42
|
+
```
|
43
|
+
|
44
|
+
## Options
|
45
|
+
|
46
|
+
- `--aws-access-key ACCESS_KEY` "AWS Access Key"
|
47
|
+
- `--aws-secret-access-key SECRET_KEY` "AWS Secret Access Key"
|
48
|
+
- `--aws-region REGION` "AWS Region"
|
49
|
+
- `--pattern STRING` "Snapshots without this string in the description will be ignored"
|
50
|
+
- `--by-tags TAG=VALUE,TAG=VALUE` "Instead of rotating specific snapshots, rotate over all the snapshots having the intersection of all given TAG=VALUE pairs."
|
51
|
+
- `--backoff-limit INTEGER` "Backoff and retry when hitting RDS Error exceptions no more than this many times. Default is 15"
|
52
|
+
- `--create-snapshot STRING` "Use this option if you want to create a snapshot"
|
53
|
+
- `--keep-hourly INTEGER` "Number of hourly snapshots to keep"
|
54
|
+
- `--keep-daily INTEGER` "Number of daily snapshots to keep"
|
55
|
+
- `--keep-weekly INTEGER` "Number of weekly snapshots to keep"
|
56
|
+
- `--keep-last` "Keep the most recent snapshot, regardless of time-based policy"
|
57
|
+
- `--dry-run` "Shows what would happen without doing anything"
|
58
|
+
|
59
|
+
## Tips
|
60
|
+
|
61
|
+
If you are not sure what happen - add option `--dry-run`.
|
62
|
+
|
63
|
+
In that case the script will not destroy/create anything in RDS, it will just
|
64
|
+
show the messages.
|
65
|
+
|
66
|
+
## Contributing to rds-rotate-db-snapshots
|
67
|
+
|
68
|
+
- Check out the latest master to make sure the feature hasn't been
|
69
|
+
implemented or the bug hasn't been fixed yet
|
70
|
+
- Check out the issue tracker to make sure someone already hasn't requested
|
71
|
+
it and/or contributed it
|
72
|
+
- Fork the project
|
73
|
+
- Start a feature/bugfix branch
|
74
|
+
- Commit and push until you are happy with your contribution
|
75
|
+
- Make sure to add tests for it. This is important so I don't break it in a
|
76
|
+
future version unintentionally.
|
77
|
+
- Please try not to mess with the Rakefile, version, or history. If you want
|
78
|
+
to have your own version, or is otherwise necessary, that is fine, but
|
79
|
+
please isolate to its own commit so I can cherry-pick around it.
|
80
|
+
|
81
|
+
## Copyright
|
82
|
+
|
83
|
+
Copyright (c) 2014 Siarhei Kavaliou. See LICENSE.txt for further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
@@ -2,29 +2,31 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: rds-rotate-db-snapshots 0.4.
|
5
|
+
# stub: rds-rotate-db-snapshots 0.4.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "rds-rotate-db-snapshots".freeze
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Siarhei Kavaliou".freeze]
|
14
|
-
s.date = "2022-12-
|
14
|
+
s.date = "2022-12-26"
|
15
15
|
s.description = "Provides a simple way to rotate RDS DB snapshots with configurable retention periods.".freeze
|
16
16
|
s.email = "kovserg@gmail.com".freeze
|
17
17
|
s.executables = ["rds-rotate-db-snapshots".freeze]
|
18
18
|
s.extra_rdoc_files = [
|
19
19
|
"LICENSE.txt",
|
20
|
-
"README.
|
20
|
+
"README.md"
|
21
21
|
]
|
22
22
|
s.files = [
|
23
23
|
".document",
|
24
|
-
".
|
24
|
+
".github/dependabot.yml",
|
25
|
+
".github/workflows/ci.yml",
|
26
|
+
".github/workflows/codeql.yml",
|
25
27
|
"Gemfile",
|
26
28
|
"LICENSE.txt",
|
27
|
-
"README.
|
29
|
+
"README.md",
|
28
30
|
"Rakefile",
|
29
31
|
"VERSION",
|
30
32
|
"bin/rds-rotate-db-snapshots",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rds-rotate-db-snapshots
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siarhei Kavaliou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-rds
|
@@ -74,13 +74,15 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files:
|
76
76
|
- LICENSE.txt
|
77
|
-
- README.
|
77
|
+
- README.md
|
78
78
|
files:
|
79
79
|
- ".document"
|
80
|
-
- ".
|
80
|
+
- ".github/dependabot.yml"
|
81
|
+
- ".github/workflows/ci.yml"
|
82
|
+
- ".github/workflows/codeql.yml"
|
81
83
|
- Gemfile
|
82
84
|
- LICENSE.txt
|
83
|
-
- README.
|
85
|
+
- README.md
|
84
86
|
- Rakefile
|
85
87
|
- VERSION
|
86
88
|
- bin/rds-rotate-db-snapshots
|
data/.travis.yml
DELETED
data/README.rdoc
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
= rds-rotate-db-snapshots
|
2
|
-
{<img src="https://badge.fury.io/rb/rds-rotate-db-snapshots.svg" alt="Gem Version" />}[http://badge.fury.io/rb/rds-rotate-db-snapshots] {<img src="https://travis-ci.org/serg-kovalev/rds-rotate-db-snapshots.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/serg-kovalev/rds-rotate-db-snapshots] {<img src="https://hakiri.io/github/serg-kovalev/rds-rotate-db-snapshots/master.svg" alt="security" />}[https://hakiri.io/github/serg-kovalev/rds-rotate-db-snapshots/master]
|
3
|
-
|
4
|
-
Provides a simple way to rotate db snapshots in Amazon Relational Database Service (RDS).
|
5
|
-
|
6
|
-
== Tested on Rubies
|
7
|
-
- 1.9.3
|
8
|
-
- 2.1
|
9
|
-
- 2.2
|
10
|
-
- jruby
|
11
|
-
- rbx-2
|
12
|
-
|
13
|
-
== Usage
|
14
|
-
|
15
|
-
[Gem installation]
|
16
|
-
gem install rds-rotate-db-snapshots
|
17
|
-
|
18
|
-
[Usage]
|
19
|
-
rds-rotate-db-snapshots [options] <db_indentifier>
|
20
|
-
|
21
|
-
Add this script to CRON (let's say it will run this script every X hours) and it will do the job well
|
22
|
-
#/usr/bin/bash
|
23
|
-
AWS_ACCESS_KEY='xxxxxxxxxxxxxxxxxxxx'
|
24
|
-
AWS_SECRET_ACCESS_KEY='yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
25
|
-
AWS_REGION='eu-west-1'
|
26
|
-
DESCRIPTION_PREFIX='automatic-backup-'
|
27
|
-
RDS_ROTATOR=/here/is/the/path/to/rds-rotate-db-snapshots
|
28
|
-
DB_NAME='db_name_here'
|
29
|
-
|
30
|
-
$RDS_ROTATOR --aws-region $AWS_REGION --aws-access-key $AWS_ACCESS_KEY --aws-secret-access-key $AWS_SECRET_ACCESS_KEY --pattern $DESCRIPTION_PREFIX --keep-hourly 24 --keep-daily 7 --keep-weekly 4 --keep-monthly 1 --keep-yearly 0 --create-snapshot $DESCRIPTION_PREFIX$DB_NAME $DB_NAME
|
31
|
-
|
32
|
-
== Options
|
33
|
-
|
34
|
-
[--aws-access-key ACCESS_KEY] "AWS Access Key"
|
35
|
-
[--aws-secret-access-key SECRET_KEY] "AWS Secret Access Key"
|
36
|
-
[--aws-region REGION] "AWS Region"
|
37
|
-
[--pattern STRING] "Snapshots without this string in the description will be ignored"
|
38
|
-
[--by-tags TAG=VALUE,TAG=VALUE] "Instead of rotating specific snapshots, rotate over all the snapshots having the intersection of all given TAG=VALUE pairs."
|
39
|
-
[--backoff-limit INTEGER] "Backoff and retry when hitting RDS Error exceptions no more than this many times. Default is 15"
|
40
|
-
[--create-snapshot STRING] "Use this option if you want to create a snapshot"
|
41
|
-
[--keep-hourly INTEGER] "Number of hourly snapshots to keep"
|
42
|
-
[--keep-daily INTEGER] "Number of daily snapshots to keep"
|
43
|
-
[--keep-weekly INTEGER] "Number of weekly snapshots to keep"
|
44
|
-
[--keep-last] "Keep the most recent snapshot, regardless of time-based policy"
|
45
|
-
[--dry-run] "Shows what would happen without doing anything"
|
46
|
-
|
47
|
-
== Tips
|
48
|
-
|
49
|
-
If you are not sure what happen - add option "dry-run".
|
50
|
-
|
51
|
-
In that case the script will not destroy/create anything in RDS, it will just show the messages.
|
52
|
-
|
53
|
-
== Contributing to rds-rotate-db-snapshots
|
54
|
-
|
55
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
56
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
57
|
-
* Fork the project
|
58
|
-
* Start a feature/bugfix branch
|
59
|
-
* Commit and push until you are happy with your contribution
|
60
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
61
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
62
|
-
|
63
|
-
== Copyright
|
64
|
-
|
65
|
-
Copyright (c) 2014 Siarhei Kavaliou. See LICENSE.txt for further details.
|