aws_log_cleaner 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +127 -126
- data/.rspec +1 -1
- data/.travis.yml +16 -0
- data/Gemfile +4 -7
- data/LICENSE +12 -12
- data/README.md +60 -58
- data/Rakefile +12 -13
- data/aws_log_cleaner.gemspec +31 -31
- data/bin/aws_log_cleaner +69 -69
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/lib/aws_log_cleaner.rb +38 -38
- data/lib/aws_log_cleaner/api_gateway.rb +33 -33
- data/lib/aws_log_cleaner/api_gateway_retriever.rb +17 -17
- data/lib/aws_log_cleaner/aws_credentials.rb +25 -25
- data/lib/aws_log_cleaner/cloud_watch_logs.rb +53 -53
- data/lib/aws_log_cleaner/log_group_cleaner_commands.rb +56 -56
- data/lib/aws_log_cleaner/log_group_filterer.rb +17 -17
- data/lib/aws_log_cleaner/version.rb +3 -3
- metadata +4 -4
- data/Gemfile.lock +0 -162
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d9e2389006bc57357e377983859742cbc22cf614
|
|
4
|
+
data.tar.gz: b16f3d00ad984644d75e1d2f5ce7feacfd6b9812
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4fd78ad333f4748349f7d2bfaf532b9a1fcce5dec84bc77a4202e0aa700b5c28b3b6a5072cb8ecd9e551742017ff92da9ab39c6d7b7243b34b85450cc83352f1
|
|
7
|
+
data.tar.gz: bd455736d9d2629f4faf02dce2fbf271675bcffd55957803709532990ea2c61277984848d21ca4be19041d26b35057e631119be98281fe812f928db8bb60afc8
|
data/.gitignore
CHANGED
|
@@ -1,126 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
# Created by https://www.gitignore.io/api/ruby,visualstudiocode,rubymine
|
|
3
|
-
|
|
4
|
-
### Ruby ###
|
|
5
|
-
*.gem
|
|
6
|
-
*.rbc
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/
|
|
10
|
-
/
|
|
11
|
-
/
|
|
12
|
-
/spec/
|
|
13
|
-
/
|
|
14
|
-
/test/
|
|
15
|
-
/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
# .
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
build-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/
|
|
39
|
-
/
|
|
40
|
-
/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/
|
|
45
|
-
/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
# .
|
|
51
|
-
# .ruby-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
#
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.idea/**/
|
|
63
|
-
.idea
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.idea/**/dataSources
|
|
68
|
-
.idea/**/dataSources.
|
|
69
|
-
.idea/**/dataSources.
|
|
70
|
-
.idea/**/
|
|
71
|
-
.idea/**/
|
|
72
|
-
.idea/**/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.idea/**/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
crashlytics
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
!.vscode/
|
|
123
|
-
!.vscode/
|
|
124
|
-
!.vscode/
|
|
125
|
-
|
|
126
|
-
|
|
1
|
+
|
|
2
|
+
# Created by https://www.gitignore.io/api/ruby,visualstudiocode,rubymine
|
|
3
|
+
|
|
4
|
+
### Ruby ###
|
|
5
|
+
*.gem
|
|
6
|
+
*.rbc
|
|
7
|
+
Gemfile.lock
|
|
8
|
+
/.config
|
|
9
|
+
/coverage/
|
|
10
|
+
/InstalledFiles
|
|
11
|
+
/pkg/
|
|
12
|
+
/spec/reports/
|
|
13
|
+
/spec/examples.txt
|
|
14
|
+
/test/tmp/
|
|
15
|
+
/test/version_tmp/
|
|
16
|
+
/tmp/
|
|
17
|
+
|
|
18
|
+
# Used by dotenv library to load environment variables.
|
|
19
|
+
# .env
|
|
20
|
+
|
|
21
|
+
## Specific to RubyMotion:
|
|
22
|
+
.dat*
|
|
23
|
+
.repl_history
|
|
24
|
+
build/
|
|
25
|
+
*.bridgesupport
|
|
26
|
+
build-iPhoneOS/
|
|
27
|
+
build-iPhoneSimulator/
|
|
28
|
+
|
|
29
|
+
## Specific to RubyMotion (use of CocoaPods):
|
|
30
|
+
#
|
|
31
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
|
32
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
|
33
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
|
34
|
+
#
|
|
35
|
+
# vendor/Pods/
|
|
36
|
+
|
|
37
|
+
## Documentation cache and generated files:
|
|
38
|
+
/.yardoc/
|
|
39
|
+
/_yardoc/
|
|
40
|
+
/doc/
|
|
41
|
+
/rdoc/
|
|
42
|
+
|
|
43
|
+
## Environment normalization:
|
|
44
|
+
/.bundle/
|
|
45
|
+
/vendor/bundle
|
|
46
|
+
/lib/bundler/man/
|
|
47
|
+
|
|
48
|
+
# for a library or gem, you might want to ignore these files since the code is
|
|
49
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
50
|
+
# Gemfile.lock
|
|
51
|
+
# .ruby-version
|
|
52
|
+
# .ruby-gemset
|
|
53
|
+
|
|
54
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
55
|
+
.rvmrc
|
|
56
|
+
|
|
57
|
+
### RubyMine ###
|
|
58
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
|
59
|
+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
|
60
|
+
|
|
61
|
+
# User-specific stuff:
|
|
62
|
+
.idea/**/workspace.xml
|
|
63
|
+
.idea/**/tasks.xml
|
|
64
|
+
.idea/dictionaries
|
|
65
|
+
|
|
66
|
+
# Sensitive or high-churn files:
|
|
67
|
+
.idea/**/dataSources/
|
|
68
|
+
.idea/**/dataSources.ids
|
|
69
|
+
.idea/**/dataSources.xml
|
|
70
|
+
.idea/**/dataSources.local.xml
|
|
71
|
+
.idea/**/sqlDataSources.xml
|
|
72
|
+
.idea/**/dynamic.xml
|
|
73
|
+
.idea/**/uiDesigner.xml
|
|
74
|
+
|
|
75
|
+
# Gradle:
|
|
76
|
+
.idea/**/gradle.xml
|
|
77
|
+
.idea/**/libraries
|
|
78
|
+
|
|
79
|
+
# CMake
|
|
80
|
+
cmake-build-debug/
|
|
81
|
+
|
|
82
|
+
# Mongo Explorer plugin:
|
|
83
|
+
.idea/**/mongoSettings.xml
|
|
84
|
+
|
|
85
|
+
## File-based project format:
|
|
86
|
+
*.iws
|
|
87
|
+
|
|
88
|
+
## Plugin-specific files:
|
|
89
|
+
|
|
90
|
+
# IntelliJ
|
|
91
|
+
/out/
|
|
92
|
+
|
|
93
|
+
# mpeltonen/sbt-idea plugin
|
|
94
|
+
.idea_modules/
|
|
95
|
+
|
|
96
|
+
# JIRA plugin
|
|
97
|
+
atlassian-ide-plugin.xml
|
|
98
|
+
|
|
99
|
+
# Cursive Clojure plugin
|
|
100
|
+
.idea/replstate.xml
|
|
101
|
+
|
|
102
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
|
103
|
+
com_crashlytics_export_strings.xml
|
|
104
|
+
crashlytics.properties
|
|
105
|
+
crashlytics-build.properties
|
|
106
|
+
fabric.properties
|
|
107
|
+
|
|
108
|
+
### RubyMine Patch ###
|
|
109
|
+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
|
110
|
+
|
|
111
|
+
.idea/
|
|
112
|
+
*.iml
|
|
113
|
+
modules.xml
|
|
114
|
+
.idea/misc.xml
|
|
115
|
+
*.ipr
|
|
116
|
+
|
|
117
|
+
# Sonarlint plugin
|
|
118
|
+
.idea/sonarlint
|
|
119
|
+
|
|
120
|
+
### VisualStudioCode ###
|
|
121
|
+
.vscode/*
|
|
122
|
+
!.vscode/settings.json
|
|
123
|
+
!.vscode/tasks.json
|
|
124
|
+
!.vscode/launch.json
|
|
125
|
+
!.vscode/extensions.json
|
|
126
|
+
|
|
127
|
+
# End of https://www.gitignore.io/api/ruby,visualstudiocode,rubymine
|
data/.rspec
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
--require spec_helper
|
|
1
|
+
--require spec_helper
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
sudo: false
|
|
2
|
+
language: ruby
|
|
3
|
+
rvm:
|
|
4
|
+
- 2.1.6
|
|
5
|
+
before_install: gem install bundler -v 1.14.6
|
|
6
|
+
os:
|
|
7
|
+
- linux
|
|
8
|
+
- osx
|
|
9
|
+
deploy:
|
|
10
|
+
provider: rubygems
|
|
11
|
+
api_key:
|
|
12
|
+
secure: MkzFSS1N531sgP+f8MCDHbpXMUUaM/4was8tGW7yaSbfs5B0M/DK4jHEWT0jHS5RoXZcKldr5elx200Wz6IlqFP+9XWPTd14HWTn+XZn53yrvoJhO/b2bxRK5905RjrLaXoC4yzWK9v+ILTumVsHWefAwGq2SBlK0CsFWNHQEwP2T9hN3QRovGyopLoGRR++TgL8jw8TNE70O/QjX7JACRy/CUUKQE4XqAYUsq3BuHe7Vur+1KMN00++ja8THPLUcVR+Paf/qHhCTyIIMkpOJ81GIPgEuRFPH4hGhooRZlTcizp0fl7WXqNJGVhl7sVsG00ExFp51fxaG/ZH5Ho5St9GyXuWp7QQfXnCsNp3tWrPs7/tWQZiqJWhOk7XoHPd9I/gSJj24fxi935EkDaNc8XrFh9Rw1kC9rhSaquY+gNuE9iMARgE3p2YWEVTvmrjSXFPONC0fc7iIXkixJt6URVShrU4gZyT5UC0VcmaC/f6Oo0fBkeVs2d8jTx5I/hP1UTeRIjZPEaFLf/mhbbQ502nWRj1MYHVC7PKQWyerkch82ckkEj25w+Xw82sz0Ac99/9tzEIw7Q0Ex6Xi2GaqhTmzvIdo3GViv8Ehj8xw0kh4TqPNvyNdKV89eIoRy2oL3tnq9oLLEVEF2nfGqRjAbrqI06aFSVJyylDGzEg1HA=
|
|
13
|
+
gem: aws_log_cleaner
|
|
14
|
+
on:
|
|
15
|
+
tags: true
|
|
16
|
+
repo: daniebker/aws_log_cleaner
|
data/Gemfile
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
# dependencies specified in aws_log_cleaner.gemspec
|
|
4
|
-
gemspec
|
|
5
|
-
|
|
6
|
-
source 'http://vbuartifactory.vistaprint.svc/artifactory/api/gems/gems-release-local'
|
|
7
|
-
gem 'vp_devkit_dotnet'
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# dependencies specified in aws_log_cleaner.gemspec
|
|
4
|
+
gemspec
|
data/LICENSE
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Copyright 2017 Cimpress
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
See the License for the specific language governing permissions and
|
|
1
|
+
Copyright 2017 Cimpress
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
13
|
limitations under the License.
|
data/README.md
CHANGED
|
@@ -1,59 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
[](https://travis-ci.org/daniebker/aws_log_cleaner)
|
|
2
|
+
|
|
3
|
+
# AwsLogCleaner
|
|
4
|
+
|
|
5
|
+
A gem to clean up aws lambda and Api Gateway log groups that contain a search term.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your application's Gemfile:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
gem 'aws_log_cleaner'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
$ bundle
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
|
|
21
|
+
$ gem install aws_log_cleaner
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
### Requirements
|
|
26
|
+
|
|
27
|
+
* `AWS_SECRET_KEY` & `AWS_ACCESS_KEY` env variables must be set.
|
|
28
|
+
OR
|
|
29
|
+
* A credentials file must be present in `~\.aws`
|
|
30
|
+
|
|
31
|
+
The application defaults to `eu-west-1` but this can be overridden using `AWS_DEFAULT_REGION` environment variable.
|
|
32
|
+
|
|
33
|
+
### From the command line
|
|
34
|
+
|
|
35
|
+
* Get help by using:
|
|
36
|
+
|
|
37
|
+
`aws_log_cleaner -h`
|
|
38
|
+
|
|
39
|
+
* Run the plan command in eu-west-1 where prefix like some_text.
|
|
40
|
+
|
|
41
|
+
`aws_log_cleaner -p -l 'some_text' -r 'eu-west-1' -k [ACCESS_KEY] -s [SECRET]`
|
|
42
|
+
|
|
43
|
+
## Code
|
|
44
|
+
|
|
45
|
+
Initialise a new LogCleaner
|
|
46
|
+
|
|
47
|
+
`log_cleaner = AwsLogCleaner::AwsLogCleaner.new`
|
|
48
|
+
|
|
49
|
+
Run a plan
|
|
50
|
+
|
|
51
|
+
`log_cleaner.plan('some_text')`
|
|
52
|
+
|
|
53
|
+
Or run a delete
|
|
54
|
+
|
|
55
|
+
`log_cleaner.delete('some_text')`
|
|
56
|
+
|
|
57
|
+
## Development
|
|
58
|
+
|
|
59
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
60
|
+
|
|
59
61
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
data/Rakefile
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
require 'bundler/gem_tasks'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
end
|
|
1
|
+
|
|
2
|
+
require 'bundler/gem_tasks'
|
|
3
|
+
|
|
4
|
+
require_relative 'lib/aws_log_cleaner'
|
|
5
|
+
|
|
6
|
+
task default: :spec
|
|
7
|
+
|
|
8
|
+
begin
|
|
9
|
+
require 'rspec/core/rake_task'
|
|
10
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
11
|
+
rescue LoadError
|
|
12
|
+
end
|