aws-clean 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.gitmodules +3 -0
- data/.rspec +2 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +662 -0
- data/Guardfile +19 -0
- data/LICENSE.txt +22 -0
- data/README.md +52 -0
- data/Rakefile +6 -0
- data/aws-clean.gemspec +40 -0
- data/exe/aws-clean +14 -0
- data/lib/aws-clean.rb +17 -0
- data/lib/aws_clean/aws_services.rb +7 -0
- data/lib/aws_clean/base.rb +21 -0
- data/lib/aws_clean/cli.rb +18 -0
- data/lib/aws_clean/command.rb +25 -0
- data/lib/aws_clean/help/keypair.md +5 -0
- data/lib/aws_clean/help/sg.md +5 -0
- data/lib/aws_clean/help.rb +9 -0
- data/lib/aws_clean/keypair.rb +22 -0
- data/lib/aws_clean/security_group.rb +21 -0
- data/lib/aws_clean/version.rb +3 -0
- data/spec/lib/cli_spec.rb +17 -0
- data/spec/spec_helper.rb +24 -0
- metadata +282 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c08ed23a8917a1fec84901e6094207e771781243
|
4
|
+
data.tar.gz: 15e659772870c2cd214494e5b335edc23649138b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a1515c5336e2009d0a4bc3c0e37974a01efbc03a3250a7e111522cf3995f448c3fa3c556652b014f7de1396efc01113302c085e10cbcaa13c876288b14b7e6e7
|
7
|
+
data.tar.gz: 8ff13726f7d56331900b0c128017d76425e9d9f5c50dc300e6de6b2b3f79f95507e7f806f79097511da749d33e36aadcdc0901acf068ade4dc7ad1f84538850c
|
data/.gitignore
ADDED
data/.gitmodules
ADDED
data/.rspec
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,662 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
aws-clean (0.0.1)
|
5
|
+
actionview
|
6
|
+
activesupport
|
7
|
+
aws-sdk
|
8
|
+
colorize
|
9
|
+
facets
|
10
|
+
hashie
|
11
|
+
json
|
12
|
+
text-table
|
13
|
+
thor
|
14
|
+
|
15
|
+
GEM
|
16
|
+
remote: https://rubygems.org/
|
17
|
+
specs:
|
18
|
+
actionview (5.1.4)
|
19
|
+
activesupport (= 5.1.4)
|
20
|
+
builder (~> 3.1)
|
21
|
+
erubi (~> 1.4)
|
22
|
+
rails-dom-testing (~> 2.0)
|
23
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
24
|
+
activesupport (5.1.4)
|
25
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
26
|
+
i18n (~> 0.7)
|
27
|
+
minitest (~> 5.1)
|
28
|
+
tzinfo (~> 1.1)
|
29
|
+
aws-partitions (1.53.0)
|
30
|
+
aws-sdk (3.0.1)
|
31
|
+
aws-sdk-resources (~> 3)
|
32
|
+
aws-sdk-acm (1.2.0)
|
33
|
+
aws-sdk-core (~> 3)
|
34
|
+
aws-sigv4 (~> 1.0)
|
35
|
+
aws-sdk-alexaforbusiness (1.0.0)
|
36
|
+
aws-sdk-core (~> 3)
|
37
|
+
aws-sigv4 (~> 1.0)
|
38
|
+
aws-sdk-apigateway (1.9.0)
|
39
|
+
aws-sdk-core (~> 3)
|
40
|
+
aws-sigv4 (~> 1.0)
|
41
|
+
aws-sdk-applicationautoscaling (1.6.0)
|
42
|
+
aws-sdk-core (~> 3)
|
43
|
+
aws-sigv4 (~> 1.0)
|
44
|
+
aws-sdk-applicationdiscoveryservice (1.0.0)
|
45
|
+
aws-sdk-core (~> 3)
|
46
|
+
aws-sigv4 (~> 1.0)
|
47
|
+
aws-sdk-appstream (1.4.0)
|
48
|
+
aws-sdk-core (~> 3)
|
49
|
+
aws-sigv4 (~> 1.0)
|
50
|
+
aws-sdk-appsync (1.0.0)
|
51
|
+
aws-sdk-core (~> 3)
|
52
|
+
aws-sigv4 (~> 1.0)
|
53
|
+
aws-sdk-athena (1.0.0)
|
54
|
+
aws-sdk-core (~> 3)
|
55
|
+
aws-sigv4 (~> 1.0)
|
56
|
+
aws-sdk-autoscaling (1.4.0)
|
57
|
+
aws-sdk-core (~> 3)
|
58
|
+
aws-sigv4 (~> 1.0)
|
59
|
+
aws-sdk-batch (1.3.0)
|
60
|
+
aws-sdk-core (~> 3)
|
61
|
+
aws-sigv4 (~> 1.0)
|
62
|
+
aws-sdk-budgets (1.3.0)
|
63
|
+
aws-sdk-core (~> 3)
|
64
|
+
aws-sigv4 (~> 1.0)
|
65
|
+
aws-sdk-cloud9 (1.0.0)
|
66
|
+
aws-sdk-core (~> 3)
|
67
|
+
aws-sigv4 (~> 1.0)
|
68
|
+
aws-sdk-clouddirectory (1.1.0)
|
69
|
+
aws-sdk-core (~> 3)
|
70
|
+
aws-sigv4 (~> 1.0)
|
71
|
+
aws-sdk-cloudformation (1.3.0)
|
72
|
+
aws-sdk-core (~> 3)
|
73
|
+
aws-sigv4 (~> 1.0)
|
74
|
+
aws-sdk-cloudfront (1.1.0)
|
75
|
+
aws-sdk-core (~> 3)
|
76
|
+
aws-sigv4 (~> 1.0)
|
77
|
+
aws-sdk-cloudhsm (1.3.0)
|
78
|
+
aws-sdk-core (~> 3)
|
79
|
+
aws-sigv4 (~> 1.0)
|
80
|
+
aws-sdk-cloudhsmv2 (1.1.0)
|
81
|
+
aws-sdk-core (~> 3)
|
82
|
+
aws-sigv4 (~> 1.0)
|
83
|
+
aws-sdk-cloudsearch (1.0.0)
|
84
|
+
aws-sdk-core (~> 3)
|
85
|
+
aws-sigv4 (~> 1.0)
|
86
|
+
aws-sdk-cloudsearchdomain (1.0.0)
|
87
|
+
aws-sdk-core (~> 3)
|
88
|
+
aws-sigv4 (~> 1.0)
|
89
|
+
aws-sdk-cloudtrail (1.0.0)
|
90
|
+
aws-sdk-core (~> 3)
|
91
|
+
aws-sigv4 (~> 1.0)
|
92
|
+
aws-sdk-cloudwatch (1.4.0)
|
93
|
+
aws-sdk-core (~> 3)
|
94
|
+
aws-sigv4 (~> 1.0)
|
95
|
+
aws-sdk-cloudwatchevents (1.1.0)
|
96
|
+
aws-sdk-core (~> 3)
|
97
|
+
aws-sigv4 (~> 1.0)
|
98
|
+
aws-sdk-cloudwatchlogs (1.2.0)
|
99
|
+
aws-sdk-core (~> 3)
|
100
|
+
aws-sigv4 (~> 1.0)
|
101
|
+
aws-sdk-codebuild (1.5.0)
|
102
|
+
aws-sdk-core (~> 3)
|
103
|
+
aws-sigv4 (~> 1.0)
|
104
|
+
aws-sdk-codecommit (1.2.0)
|
105
|
+
aws-sdk-core (~> 3)
|
106
|
+
aws-sigv4 (~> 1.0)
|
107
|
+
aws-sdk-codedeploy (1.2.0)
|
108
|
+
aws-sdk-core (~> 3)
|
109
|
+
aws-sigv4 (~> 1.0)
|
110
|
+
aws-sdk-codepipeline (1.1.0)
|
111
|
+
aws-sdk-core (~> 3)
|
112
|
+
aws-sigv4 (~> 1.0)
|
113
|
+
aws-sdk-codestar (1.1.0)
|
114
|
+
aws-sdk-core (~> 3)
|
115
|
+
aws-sigv4 (~> 1.0)
|
116
|
+
aws-sdk-cognitoidentity (1.0.0)
|
117
|
+
aws-sdk-core (~> 3)
|
118
|
+
aws-sigv4 (~> 1.0)
|
119
|
+
aws-sdk-cognitoidentityprovider (1.2.0)
|
120
|
+
aws-sdk-core (~> 3)
|
121
|
+
aws-sigv4 (~> 1.0)
|
122
|
+
aws-sdk-cognitosync (1.0.0)
|
123
|
+
aws-sdk-core (~> 3)
|
124
|
+
aws-sigv4 (~> 1.0)
|
125
|
+
aws-sdk-comprehend (1.0.0)
|
126
|
+
aws-sdk-core (~> 3)
|
127
|
+
aws-sigv4 (~> 1.0)
|
128
|
+
aws-sdk-configservice (1.5.0)
|
129
|
+
aws-sdk-core (~> 3)
|
130
|
+
aws-sigv4 (~> 1.0)
|
131
|
+
aws-sdk-core (3.13.0)
|
132
|
+
aws-partitions (~> 1.0)
|
133
|
+
aws-sigv4 (~> 1.0)
|
134
|
+
jmespath (~> 1.0)
|
135
|
+
aws-sdk-costandusagereportservice (1.0.0)
|
136
|
+
aws-sdk-core (~> 3)
|
137
|
+
aws-sigv4 (~> 1.0)
|
138
|
+
aws-sdk-costexplorer (1.0.0)
|
139
|
+
aws-sdk-core (~> 3)
|
140
|
+
aws-sigv4 (~> 1.0)
|
141
|
+
aws-sdk-databasemigrationservice (1.3.0)
|
142
|
+
aws-sdk-core (~> 3)
|
143
|
+
aws-sigv4 (~> 1.0)
|
144
|
+
aws-sdk-datapipeline (1.0.0)
|
145
|
+
aws-sdk-core (~> 3)
|
146
|
+
aws-sigv4 (~> 1.0)
|
147
|
+
aws-sdk-dax (1.0.0)
|
148
|
+
aws-sdk-core (~> 3)
|
149
|
+
aws-sigv4 (~> 1.0)
|
150
|
+
aws-sdk-devicefarm (1.2.0)
|
151
|
+
aws-sdk-core (~> 3)
|
152
|
+
aws-sigv4 (~> 1.0)
|
153
|
+
aws-sdk-directconnect (1.1.0)
|
154
|
+
aws-sdk-core (~> 3)
|
155
|
+
aws-sigv4 (~> 1.0)
|
156
|
+
aws-sdk-directoryservice (1.0.0)
|
157
|
+
aws-sdk-core (~> 3)
|
158
|
+
aws-sigv4 (~> 1.0)
|
159
|
+
aws-sdk-dynamodb (1.3.0)
|
160
|
+
aws-sdk-core (~> 3)
|
161
|
+
aws-sigv4 (~> 1.0)
|
162
|
+
aws-sdk-dynamodbstreams (1.0.0)
|
163
|
+
aws-sdk-core (~> 3)
|
164
|
+
aws-sigv4 (~> 1.0)
|
165
|
+
aws-sdk-ec2 (1.24.0)
|
166
|
+
aws-sdk-core (~> 3)
|
167
|
+
aws-sigv4 (~> 1.0)
|
168
|
+
aws-sdk-ecr (1.2.0)
|
169
|
+
aws-sdk-core (~> 3)
|
170
|
+
aws-sigv4 (~> 1.0)
|
171
|
+
aws-sdk-ecs (1.8.0)
|
172
|
+
aws-sdk-core (~> 3)
|
173
|
+
aws-sigv4 (~> 1.0)
|
174
|
+
aws-sdk-efs (1.0.0)
|
175
|
+
aws-sdk-core (~> 3)
|
176
|
+
aws-sigv4 (~> 1.0)
|
177
|
+
aws-sdk-elasticache (1.3.0)
|
178
|
+
aws-sdk-core (~> 3)
|
179
|
+
aws-sigv4 (~> 1.0)
|
180
|
+
aws-sdk-elasticbeanstalk (1.3.0)
|
181
|
+
aws-sdk-core (~> 3)
|
182
|
+
aws-sigv4 (~> 1.0)
|
183
|
+
aws-sdk-elasticloadbalancing (1.1.0)
|
184
|
+
aws-sdk-core (~> 3)
|
185
|
+
aws-sigv4 (~> 1.0)
|
186
|
+
aws-sdk-elasticloadbalancingv2 (1.6.0)
|
187
|
+
aws-sdk-core (~> 3)
|
188
|
+
aws-sigv4 (~> 1.0)
|
189
|
+
aws-sdk-elasticsearchservice (1.3.0)
|
190
|
+
aws-sdk-core (~> 3)
|
191
|
+
aws-sigv4 (~> 1.0)
|
192
|
+
aws-sdk-elastictranscoder (1.0.0)
|
193
|
+
aws-sdk-core (~> 3)
|
194
|
+
aws-sigv4 (~> 1.0)
|
195
|
+
aws-sdk-emr (1.1.0)
|
196
|
+
aws-sdk-core (~> 3)
|
197
|
+
aws-sigv4 (~> 1.0)
|
198
|
+
aws-sdk-firehose (1.1.0)
|
199
|
+
aws-sdk-core (~> 3)
|
200
|
+
aws-sigv4 (~> 1.0)
|
201
|
+
aws-sdk-gamelift (1.1.0)
|
202
|
+
aws-sdk-core (~> 3)
|
203
|
+
aws-sigv4 (~> 1.0)
|
204
|
+
aws-sdk-glacier (1.5.0)
|
205
|
+
aws-sdk-core (~> 3)
|
206
|
+
aws-sigv4 (~> 1.0)
|
207
|
+
aws-sdk-glue (1.2.0)
|
208
|
+
aws-sdk-core (~> 3)
|
209
|
+
aws-sigv4 (~> 1.0)
|
210
|
+
aws-sdk-greengrass (1.2.0)
|
211
|
+
aws-sdk-core (~> 3)
|
212
|
+
aws-sigv4 (~> 1.0)
|
213
|
+
aws-sdk-guardduty (1.0.0)
|
214
|
+
aws-sdk-core (~> 3)
|
215
|
+
aws-sigv4 (~> 1.0)
|
216
|
+
aws-sdk-health (1.0.0)
|
217
|
+
aws-sdk-core (~> 3)
|
218
|
+
aws-sigv4 (~> 1.0)
|
219
|
+
aws-sdk-iam (1.3.0)
|
220
|
+
aws-sdk-core (~> 3)
|
221
|
+
aws-sigv4 (~> 1.0)
|
222
|
+
aws-sdk-importexport (1.0.0)
|
223
|
+
aws-sdk-core (~> 3)
|
224
|
+
aws-sigv2 (~> 1.0)
|
225
|
+
aws-sdk-inspector (1.2.0)
|
226
|
+
aws-sdk-core (~> 3)
|
227
|
+
aws-sigv4 (~> 1.0)
|
228
|
+
aws-sdk-iot (1.3.0)
|
229
|
+
aws-sdk-core (~> 3)
|
230
|
+
aws-sigv4 (~> 1.0)
|
231
|
+
aws-sdk-iotdataplane (1.0.0)
|
232
|
+
aws-sdk-core (~> 3)
|
233
|
+
aws-sigv4 (~> 1.0)
|
234
|
+
aws-sdk-iotjobsdataplane (1.0.0)
|
235
|
+
aws-sdk-core (~> 3)
|
236
|
+
aws-sigv4 (~> 1.0)
|
237
|
+
aws-sdk-kinesis (1.1.0)
|
238
|
+
aws-sdk-core (~> 3)
|
239
|
+
aws-sigv4 (~> 1.0)
|
240
|
+
aws-sdk-kinesisanalytics (1.2.0)
|
241
|
+
aws-sdk-core (~> 3)
|
242
|
+
aws-sigv4 (~> 1.0)
|
243
|
+
aws-sdk-kinesisvideo (1.0.0)
|
244
|
+
aws-sdk-core (~> 3)
|
245
|
+
aws-sigv4 (~> 1.0)
|
246
|
+
aws-sdk-kinesisvideoarchivedmedia (1.0.0)
|
247
|
+
aws-sdk-core (~> 3)
|
248
|
+
aws-sigv4 (~> 1.0)
|
249
|
+
aws-sdk-kinesisvideomedia (1.0.0)
|
250
|
+
aws-sdk-core (~> 3)
|
251
|
+
aws-sigv4 (~> 1.0)
|
252
|
+
aws-sdk-kms (1.3.0)
|
253
|
+
aws-sdk-core (~> 3)
|
254
|
+
aws-sigv4 (~> 1.0)
|
255
|
+
aws-sdk-lambda (1.2.0)
|
256
|
+
aws-sdk-core (~> 3)
|
257
|
+
aws-sigv4 (~> 1.0)
|
258
|
+
aws-sdk-lambdapreview (1.0.0)
|
259
|
+
aws-sdk-core (~> 3)
|
260
|
+
aws-sigv4 (~> 1.0)
|
261
|
+
aws-sdk-lex (1.2.0)
|
262
|
+
aws-sdk-core (~> 3)
|
263
|
+
aws-sigv4 (~> 1.0)
|
264
|
+
aws-sdk-lexmodelbuildingservice (1.3.0)
|
265
|
+
aws-sdk-core (~> 3)
|
266
|
+
aws-sigv4 (~> 1.0)
|
267
|
+
aws-sdk-lightsail (1.3.0)
|
268
|
+
aws-sdk-core (~> 3)
|
269
|
+
aws-sigv4 (~> 1.0)
|
270
|
+
aws-sdk-machinelearning (1.0.0)
|
271
|
+
aws-sdk-core (~> 3)
|
272
|
+
aws-sigv4 (~> 1.0)
|
273
|
+
aws-sdk-marketplacecommerceanalytics (1.0.0)
|
274
|
+
aws-sdk-core (~> 3)
|
275
|
+
aws-sigv4 (~> 1.0)
|
276
|
+
aws-sdk-marketplaceentitlementservice (1.0.0)
|
277
|
+
aws-sdk-core (~> 3)
|
278
|
+
aws-sigv4 (~> 1.0)
|
279
|
+
aws-sdk-marketplacemetering (1.0.0)
|
280
|
+
aws-sdk-core (~> 3)
|
281
|
+
aws-sigv4 (~> 1.0)
|
282
|
+
aws-sdk-mediaconvert (1.0.0)
|
283
|
+
aws-sdk-core (~> 3)
|
284
|
+
aws-sigv4 (~> 1.0)
|
285
|
+
aws-sdk-medialive (1.0.0)
|
286
|
+
aws-sdk-core (~> 3)
|
287
|
+
aws-sigv4 (~> 1.0)
|
288
|
+
aws-sdk-mediapackage (1.0.0)
|
289
|
+
aws-sdk-core (~> 3)
|
290
|
+
aws-sigv4 (~> 1.0)
|
291
|
+
aws-sdk-mediastore (1.0.0)
|
292
|
+
aws-sdk-core (~> 3)
|
293
|
+
aws-sigv4 (~> 1.0)
|
294
|
+
aws-sdk-mediastoredata (1.1.0)
|
295
|
+
aws-sdk-core (~> 3)
|
296
|
+
aws-sigv4 (~> 1.0)
|
297
|
+
aws-sdk-migrationhub (1.0.0)
|
298
|
+
aws-sdk-core (~> 3)
|
299
|
+
aws-sigv4 (~> 1.0)
|
300
|
+
aws-sdk-mobile (1.0.0)
|
301
|
+
aws-sdk-core (~> 3)
|
302
|
+
aws-sigv4 (~> 1.0)
|
303
|
+
aws-sdk-mq (1.0.0)
|
304
|
+
aws-sdk-core (~> 3)
|
305
|
+
aws-sigv4 (~> 1.0)
|
306
|
+
aws-sdk-mturk (1.1.0)
|
307
|
+
aws-sdk-core (~> 3)
|
308
|
+
aws-sigv4 (~> 1.0)
|
309
|
+
aws-sdk-opsworks (1.1.0)
|
310
|
+
aws-sdk-core (~> 3)
|
311
|
+
aws-sigv4 (~> 1.0)
|
312
|
+
aws-sdk-opsworkscm (1.2.0)
|
313
|
+
aws-sdk-core (~> 3)
|
314
|
+
aws-sigv4 (~> 1.0)
|
315
|
+
aws-sdk-organizations (1.7.0)
|
316
|
+
aws-sdk-core (~> 3)
|
317
|
+
aws-sigv4 (~> 1.0)
|
318
|
+
aws-sdk-pinpoint (1.2.0)
|
319
|
+
aws-sdk-core (~> 3)
|
320
|
+
aws-sigv4 (~> 1.0)
|
321
|
+
aws-sdk-polly (1.4.0)
|
322
|
+
aws-sdk-core (~> 3)
|
323
|
+
aws-sigv4 (~> 1.0)
|
324
|
+
aws-sdk-pricing (1.0.0)
|
325
|
+
aws-sdk-core (~> 3)
|
326
|
+
aws-sigv4 (~> 1.0)
|
327
|
+
aws-sdk-rds (1.9.0)
|
328
|
+
aws-sdk-core (~> 3)
|
329
|
+
aws-sigv4 (~> 1.0)
|
330
|
+
aws-sdk-redshift (1.1.0)
|
331
|
+
aws-sdk-core (~> 3)
|
332
|
+
aws-sigv4 (~> 1.0)
|
333
|
+
aws-sdk-rekognition (1.2.0)
|
334
|
+
aws-sdk-core (~> 3)
|
335
|
+
aws-sigv4 (~> 1.0)
|
336
|
+
aws-sdk-resourcegroups (1.0.0)
|
337
|
+
aws-sdk-core (~> 3)
|
338
|
+
aws-sigv4 (~> 1.0)
|
339
|
+
aws-sdk-resourcegroupstaggingapi (1.0.0)
|
340
|
+
aws-sdk-core (~> 3)
|
341
|
+
aws-sigv4 (~> 1.0)
|
342
|
+
aws-sdk-resources (3.10.0)
|
343
|
+
aws-sdk-acm (~> 1)
|
344
|
+
aws-sdk-alexaforbusiness (~> 1)
|
345
|
+
aws-sdk-apigateway (~> 1)
|
346
|
+
aws-sdk-applicationautoscaling (~> 1)
|
347
|
+
aws-sdk-applicationdiscoveryservice (~> 1)
|
348
|
+
aws-sdk-appstream (~> 1)
|
349
|
+
aws-sdk-appsync (~> 1)
|
350
|
+
aws-sdk-athena (~> 1)
|
351
|
+
aws-sdk-autoscaling (~> 1)
|
352
|
+
aws-sdk-batch (~> 1)
|
353
|
+
aws-sdk-budgets (~> 1)
|
354
|
+
aws-sdk-cloud9 (~> 1)
|
355
|
+
aws-sdk-clouddirectory (~> 1)
|
356
|
+
aws-sdk-cloudformation (~> 1)
|
357
|
+
aws-sdk-cloudfront (~> 1)
|
358
|
+
aws-sdk-cloudhsm (~> 1)
|
359
|
+
aws-sdk-cloudhsmv2 (~> 1)
|
360
|
+
aws-sdk-cloudsearch (~> 1)
|
361
|
+
aws-sdk-cloudsearchdomain (~> 1)
|
362
|
+
aws-sdk-cloudtrail (~> 1)
|
363
|
+
aws-sdk-cloudwatch (~> 1)
|
364
|
+
aws-sdk-cloudwatchevents (~> 1)
|
365
|
+
aws-sdk-cloudwatchlogs (~> 1)
|
366
|
+
aws-sdk-codebuild (~> 1)
|
367
|
+
aws-sdk-codecommit (~> 1)
|
368
|
+
aws-sdk-codedeploy (~> 1)
|
369
|
+
aws-sdk-codepipeline (~> 1)
|
370
|
+
aws-sdk-codestar (~> 1)
|
371
|
+
aws-sdk-cognitoidentity (~> 1)
|
372
|
+
aws-sdk-cognitoidentityprovider (~> 1)
|
373
|
+
aws-sdk-cognitosync (~> 1)
|
374
|
+
aws-sdk-comprehend (~> 1)
|
375
|
+
aws-sdk-configservice (~> 1)
|
376
|
+
aws-sdk-costandusagereportservice (~> 1)
|
377
|
+
aws-sdk-costexplorer (~> 1)
|
378
|
+
aws-sdk-databasemigrationservice (~> 1)
|
379
|
+
aws-sdk-datapipeline (~> 1)
|
380
|
+
aws-sdk-dax (~> 1)
|
381
|
+
aws-sdk-devicefarm (~> 1)
|
382
|
+
aws-sdk-directconnect (~> 1)
|
383
|
+
aws-sdk-directoryservice (~> 1)
|
384
|
+
aws-sdk-dynamodb (~> 1)
|
385
|
+
aws-sdk-dynamodbstreams (~> 1)
|
386
|
+
aws-sdk-ec2 (~> 1)
|
387
|
+
aws-sdk-ecr (~> 1)
|
388
|
+
aws-sdk-ecs (~> 1)
|
389
|
+
aws-sdk-efs (~> 1)
|
390
|
+
aws-sdk-elasticache (~> 1)
|
391
|
+
aws-sdk-elasticbeanstalk (~> 1)
|
392
|
+
aws-sdk-elasticloadbalancing (~> 1)
|
393
|
+
aws-sdk-elasticloadbalancingv2 (~> 1)
|
394
|
+
aws-sdk-elasticsearchservice (~> 1)
|
395
|
+
aws-sdk-elastictranscoder (~> 1)
|
396
|
+
aws-sdk-emr (~> 1)
|
397
|
+
aws-sdk-firehose (~> 1)
|
398
|
+
aws-sdk-gamelift (~> 1)
|
399
|
+
aws-sdk-glacier (~> 1)
|
400
|
+
aws-sdk-glue (~> 1)
|
401
|
+
aws-sdk-greengrass (~> 1)
|
402
|
+
aws-sdk-guardduty (~> 1)
|
403
|
+
aws-sdk-health (~> 1)
|
404
|
+
aws-sdk-iam (~> 1)
|
405
|
+
aws-sdk-importexport (~> 1)
|
406
|
+
aws-sdk-inspector (~> 1)
|
407
|
+
aws-sdk-iot (~> 1)
|
408
|
+
aws-sdk-iotdataplane (~> 1)
|
409
|
+
aws-sdk-iotjobsdataplane (~> 1)
|
410
|
+
aws-sdk-kinesis (~> 1)
|
411
|
+
aws-sdk-kinesisanalytics (~> 1)
|
412
|
+
aws-sdk-kinesisvideo (~> 1)
|
413
|
+
aws-sdk-kinesisvideoarchivedmedia (~> 1)
|
414
|
+
aws-sdk-kinesisvideomedia (~> 1)
|
415
|
+
aws-sdk-kms (~> 1)
|
416
|
+
aws-sdk-lambda (~> 1)
|
417
|
+
aws-sdk-lambdapreview (~> 1)
|
418
|
+
aws-sdk-lex (~> 1)
|
419
|
+
aws-sdk-lexmodelbuildingservice (~> 1)
|
420
|
+
aws-sdk-lightsail (~> 1)
|
421
|
+
aws-sdk-machinelearning (~> 1)
|
422
|
+
aws-sdk-marketplacecommerceanalytics (~> 1)
|
423
|
+
aws-sdk-marketplaceentitlementservice (~> 1)
|
424
|
+
aws-sdk-marketplacemetering (~> 1)
|
425
|
+
aws-sdk-mediaconvert (~> 1)
|
426
|
+
aws-sdk-medialive (~> 1)
|
427
|
+
aws-sdk-mediapackage (~> 1)
|
428
|
+
aws-sdk-mediastore (~> 1)
|
429
|
+
aws-sdk-mediastoredata (~> 1)
|
430
|
+
aws-sdk-migrationhub (~> 1)
|
431
|
+
aws-sdk-mobile (~> 1)
|
432
|
+
aws-sdk-mq (~> 1)
|
433
|
+
aws-sdk-mturk (~> 1)
|
434
|
+
aws-sdk-opsworks (~> 1)
|
435
|
+
aws-sdk-opsworkscm (~> 1)
|
436
|
+
aws-sdk-organizations (~> 1)
|
437
|
+
aws-sdk-pinpoint (~> 1)
|
438
|
+
aws-sdk-polly (~> 1)
|
439
|
+
aws-sdk-pricing (~> 1)
|
440
|
+
aws-sdk-rds (~> 1)
|
441
|
+
aws-sdk-redshift (~> 1)
|
442
|
+
aws-sdk-rekognition (~> 1)
|
443
|
+
aws-sdk-resourcegroups (~> 1)
|
444
|
+
aws-sdk-resourcegroupstaggingapi (~> 1)
|
445
|
+
aws-sdk-route53 (~> 1)
|
446
|
+
aws-sdk-route53domains (~> 1)
|
447
|
+
aws-sdk-s3 (~> 1)
|
448
|
+
aws-sdk-sagemaker (~> 1)
|
449
|
+
aws-sdk-sagemakerruntime (~> 1)
|
450
|
+
aws-sdk-serverlessapplicationrepository (~> 1)
|
451
|
+
aws-sdk-servicecatalog (~> 1)
|
452
|
+
aws-sdk-servicediscovery (~> 1)
|
453
|
+
aws-sdk-ses (~> 1)
|
454
|
+
aws-sdk-shield (~> 1)
|
455
|
+
aws-sdk-simpledb (~> 1)
|
456
|
+
aws-sdk-sms (~> 1)
|
457
|
+
aws-sdk-snowball (~> 1)
|
458
|
+
aws-sdk-sns (~> 1)
|
459
|
+
aws-sdk-sqs (~> 1)
|
460
|
+
aws-sdk-ssm (~> 1)
|
461
|
+
aws-sdk-states (~> 1)
|
462
|
+
aws-sdk-storagegateway (~> 1)
|
463
|
+
aws-sdk-support (~> 1)
|
464
|
+
aws-sdk-swf (~> 1)
|
465
|
+
aws-sdk-translate (~> 1)
|
466
|
+
aws-sdk-waf (~> 1)
|
467
|
+
aws-sdk-wafregional (~> 1)
|
468
|
+
aws-sdk-workdocs (~> 1)
|
469
|
+
aws-sdk-workmail (~> 1)
|
470
|
+
aws-sdk-workspaces (~> 1)
|
471
|
+
aws-sdk-xray (~> 1)
|
472
|
+
aws-sdk-route53 (1.6.0)
|
473
|
+
aws-sdk-core (~> 3)
|
474
|
+
aws-sigv4 (~> 1.0)
|
475
|
+
aws-sdk-route53domains (1.1.0)
|
476
|
+
aws-sdk-core (~> 3)
|
477
|
+
aws-sigv4 (~> 1.0)
|
478
|
+
aws-sdk-s3 (1.8.0)
|
479
|
+
aws-sdk-core (~> 3)
|
480
|
+
aws-sdk-kms (~> 1)
|
481
|
+
aws-sigv4 (~> 1.0)
|
482
|
+
aws-sdk-sagemaker (1.4.0)
|
483
|
+
aws-sdk-core (~> 3)
|
484
|
+
aws-sigv4 (~> 1.0)
|
485
|
+
aws-sdk-sagemakerruntime (1.0.0)
|
486
|
+
aws-sdk-core (~> 3)
|
487
|
+
aws-sigv4 (~> 1.0)
|
488
|
+
aws-sdk-serverlessapplicationrepository (1.0.0)
|
489
|
+
aws-sdk-core (~> 3)
|
490
|
+
aws-sigv4 (~> 1.0)
|
491
|
+
aws-sdk-servicecatalog (1.2.0)
|
492
|
+
aws-sdk-core (~> 3)
|
493
|
+
aws-sigv4 (~> 1.0)
|
494
|
+
aws-sdk-servicediscovery (1.0.0)
|
495
|
+
aws-sdk-core (~> 3)
|
496
|
+
aws-sigv4 (~> 1.0)
|
497
|
+
aws-sdk-ses (1.6.0)
|
498
|
+
aws-sdk-core (~> 3)
|
499
|
+
aws-sigv4 (~> 1.0)
|
500
|
+
aws-sdk-shield (1.1.0)
|
501
|
+
aws-sdk-core (~> 3)
|
502
|
+
aws-sigv4 (~> 1.0)
|
503
|
+
aws-sdk-simpledb (1.0.0)
|
504
|
+
aws-sdk-core (~> 3)
|
505
|
+
aws-sigv2 (~> 1.0)
|
506
|
+
aws-sdk-sms (1.0.0)
|
507
|
+
aws-sdk-core (~> 3)
|
508
|
+
aws-sigv4 (~> 1.0)
|
509
|
+
aws-sdk-snowball (1.1.0)
|
510
|
+
aws-sdk-core (~> 3)
|
511
|
+
aws-sigv4 (~> 1.0)
|
512
|
+
aws-sdk-sns (1.1.0)
|
513
|
+
aws-sdk-core (~> 3)
|
514
|
+
aws-sigv4 (~> 1.0)
|
515
|
+
aws-sdk-sqs (1.3.0)
|
516
|
+
aws-sdk-core (~> 3)
|
517
|
+
aws-sigv4 (~> 1.0)
|
518
|
+
aws-sdk-ssm (1.5.0)
|
519
|
+
aws-sdk-core (~> 3)
|
520
|
+
aws-sigv4 (~> 1.0)
|
521
|
+
aws-sdk-states (1.2.0)
|
522
|
+
aws-sdk-core (~> 3)
|
523
|
+
aws-sigv4 (~> 1.0)
|
524
|
+
aws-sdk-storagegateway (1.2.0)
|
525
|
+
aws-sdk-core (~> 3)
|
526
|
+
aws-sigv4 (~> 1.0)
|
527
|
+
aws-sdk-support (1.0.0)
|
528
|
+
aws-sdk-core (~> 3)
|
529
|
+
aws-sigv4 (~> 1.0)
|
530
|
+
aws-sdk-swf (1.0.0)
|
531
|
+
aws-sdk-core (~> 3)
|
532
|
+
aws-sigv4 (~> 1.0)
|
533
|
+
aws-sdk-translate (1.0.0)
|
534
|
+
aws-sdk-core (~> 3)
|
535
|
+
aws-sigv4 (~> 1.0)
|
536
|
+
aws-sdk-waf (1.3.0)
|
537
|
+
aws-sdk-core (~> 3)
|
538
|
+
aws-sigv4 (~> 1.0)
|
539
|
+
aws-sdk-wafregional (1.3.0)
|
540
|
+
aws-sdk-core (~> 3)
|
541
|
+
aws-sigv4 (~> 1.0)
|
542
|
+
aws-sdk-workdocs (1.1.0)
|
543
|
+
aws-sdk-core (~> 3)
|
544
|
+
aws-sigv4 (~> 1.0)
|
545
|
+
aws-sdk-workmail (1.0.0)
|
546
|
+
aws-sdk-core (~> 3)
|
547
|
+
aws-sigv4 (~> 1.0)
|
548
|
+
aws-sdk-workspaces (1.1.0)
|
549
|
+
aws-sdk-core (~> 3)
|
550
|
+
aws-sigv4 (~> 1.0)
|
551
|
+
aws-sdk-xray (1.1.0)
|
552
|
+
aws-sdk-core (~> 3)
|
553
|
+
aws-sigv4 (~> 1.0)
|
554
|
+
aws-sigv2 (1.0.1)
|
555
|
+
aws-sigv4 (1.0.2)
|
556
|
+
builder (3.2.3)
|
557
|
+
byebug (9.1.0)
|
558
|
+
codeclimate-test-reporter (1.0.8)
|
559
|
+
simplecov (<= 0.13)
|
560
|
+
coderay (1.1.2)
|
561
|
+
colorize (0.8.1)
|
562
|
+
concurrent-ruby (1.0.5)
|
563
|
+
crass (1.0.3)
|
564
|
+
diff-lcs (1.3)
|
565
|
+
docile (1.1.5)
|
566
|
+
erubi (1.7.0)
|
567
|
+
facets (3.1.0)
|
568
|
+
ffi (1.9.18)
|
569
|
+
formatador (0.2.5)
|
570
|
+
guard (2.14.1)
|
571
|
+
formatador (>= 0.2.4)
|
572
|
+
listen (>= 2.7, < 4.0)
|
573
|
+
lumberjack (~> 1.0)
|
574
|
+
nenv (~> 0.1)
|
575
|
+
notiffany (~> 0.0)
|
576
|
+
pry (>= 0.9.12)
|
577
|
+
shellany (~> 0.0)
|
578
|
+
thor (>= 0.18.1)
|
579
|
+
guard-bundler (2.1.0)
|
580
|
+
bundler (~> 1.0)
|
581
|
+
guard (~> 2.2)
|
582
|
+
guard-compat (~> 1.1)
|
583
|
+
guard-compat (1.2.1)
|
584
|
+
guard-rspec (4.7.3)
|
585
|
+
guard (~> 2.1)
|
586
|
+
guard-compat (~> 1.1)
|
587
|
+
rspec (>= 2.99.0, < 4.0)
|
588
|
+
hashie (3.5.7)
|
589
|
+
i18n (0.9.1)
|
590
|
+
concurrent-ruby (~> 1.0)
|
591
|
+
jmespath (1.3.1)
|
592
|
+
json (2.1.0)
|
593
|
+
listen (3.1.5)
|
594
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
595
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
596
|
+
ruby_dep (~> 1.2)
|
597
|
+
loofah (2.1.1)
|
598
|
+
crass (~> 1.0.2)
|
599
|
+
nokogiri (>= 1.5.9)
|
600
|
+
lumberjack (1.0.12)
|
601
|
+
method_source (0.9.0)
|
602
|
+
mini_portile2 (2.3.0)
|
603
|
+
minitest (5.11.1)
|
604
|
+
nenv (0.3.0)
|
605
|
+
nokogiri (1.8.1)
|
606
|
+
mini_portile2 (~> 2.3.0)
|
607
|
+
notiffany (0.1.1)
|
608
|
+
nenv (~> 0.1)
|
609
|
+
shellany (~> 0.0)
|
610
|
+
pry (0.11.3)
|
611
|
+
coderay (~> 1.1.0)
|
612
|
+
method_source (~> 0.9.0)
|
613
|
+
rails-dom-testing (2.0.3)
|
614
|
+
activesupport (>= 4.2.0)
|
615
|
+
nokogiri (>= 1.6)
|
616
|
+
rails-html-sanitizer (1.0.3)
|
617
|
+
loofah (~> 2.0)
|
618
|
+
rake (12.3.0)
|
619
|
+
rb-fsevent (0.10.2)
|
620
|
+
rb-inotify (0.9.10)
|
621
|
+
ffi (>= 0.5.0, < 2)
|
622
|
+
rspec (3.7.0)
|
623
|
+
rspec-core (~> 3.7.0)
|
624
|
+
rspec-expectations (~> 3.7.0)
|
625
|
+
rspec-mocks (~> 3.7.0)
|
626
|
+
rspec-core (3.7.0)
|
627
|
+
rspec-support (~> 3.7.0)
|
628
|
+
rspec-expectations (3.7.0)
|
629
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
630
|
+
rspec-support (~> 3.7.0)
|
631
|
+
rspec-mocks (3.7.0)
|
632
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
633
|
+
rspec-support (~> 3.7.0)
|
634
|
+
rspec-support (3.7.0)
|
635
|
+
ruby_dep (1.5.0)
|
636
|
+
shellany (0.0.1)
|
637
|
+
simplecov (0.13.0)
|
638
|
+
docile (~> 1.1.0)
|
639
|
+
json (>= 1.8, < 3)
|
640
|
+
simplecov-html (~> 0.10.0)
|
641
|
+
simplecov-html (0.10.2)
|
642
|
+
text-table (1.2.4)
|
643
|
+
thor (0.20.0)
|
644
|
+
thread_safe (0.3.6)
|
645
|
+
tzinfo (1.2.4)
|
646
|
+
thread_safe (~> 0.1)
|
647
|
+
|
648
|
+
PLATFORMS
|
649
|
+
ruby
|
650
|
+
|
651
|
+
DEPENDENCIES
|
652
|
+
aws-clean!
|
653
|
+
bundler
|
654
|
+
byebug
|
655
|
+
codeclimate-test-reporter
|
656
|
+
guard
|
657
|
+
guard-bundler
|
658
|
+
guard-rspec
|
659
|
+
rake
|
660
|
+
|
661
|
+
BUNDLED WITH
|
662
|
+
1.16.1
|
data/Guardfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
guard "bundler", cmd: "bundle" do
|
2
|
+
watch("Gemfile")
|
3
|
+
watch(/^.+\.gemspec/)
|
4
|
+
end
|
5
|
+
|
6
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
7
|
+
require "guard/rspec/dsl"
|
8
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
9
|
+
|
10
|
+
# RSpec files
|
11
|
+
rspec = dsl.rspec
|
12
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
13
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
14
|
+
watch(rspec.spec_files)
|
15
|
+
|
16
|
+
# Ruby files
|
17
|
+
ruby = dsl.ruby
|
18
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
19
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Tung Nguyen
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Aws Clean Tool
|
2
|
+
|
3
|
+
This tool cleans up AWS resources. It does aggresively confirms with "are you sure?" prompts before deleting each resource.
|
4
|
+
|
5
|
+
If you want want to bypass the all the prompts you can use the `--sure` flag. Be careful using the `--sure` flag!
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
```sh
|
10
|
+
aws-clean sg # cleans up unused security groups
|
11
|
+
aws-clean keypair # cleans up unused keypairs
|
12
|
+
```
|
13
|
+
|
14
|
+
## Install
|
15
|
+
|
16
|
+
Add to Gemfile:
|
17
|
+
|
18
|
+
```sh
|
19
|
+
gem "aws-clean"
|
20
|
+
```
|
21
|
+
|
22
|
+
And then run:
|
23
|
+
|
24
|
+
```sh
|
25
|
+
bundle
|
26
|
+
```
|
27
|
+
|
28
|
+
Or install it with the gem command:
|
29
|
+
|
30
|
+
```sh
|
31
|
+
gem install aws-clean
|
32
|
+
```
|
33
|
+
|
34
|
+
## Development
|
35
|
+
|
36
|
+
To develop on the bleeding edge:
|
37
|
+
|
38
|
+
```sh
|
39
|
+
git clone https://github.com/tongueroo/aws-clean
|
40
|
+
git submodule init
|
41
|
+
git submodule update
|
42
|
+
```
|
43
|
+
|
44
|
+
This tool uses the [aws-inventory](https://github.com/tongueroo/aws-inventory) which is vendorized under vendor/aws-inventory.
|
45
|
+
|
46
|
+
## Contributing
|
47
|
+
|
48
|
+
1. Fork it
|
49
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
50
|
+
3. Commit your changes (`git commit -am "Add some feature"`)
|
51
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
52
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/aws-clean.gemspec
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "aws_clean/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "aws-clean"
|
8
|
+
spec.version = AwsClean::VERSION
|
9
|
+
spec.authors = ["Tung Nguyen"]
|
10
|
+
spec.email = ["tongueroo@gmail.com"]
|
11
|
+
spec.description = %q{AWS clean tool}
|
12
|
+
spec.summary = %q{AWS clean tool}
|
13
|
+
spec.homepage = "https://github.com/tongueroo/aws-clean"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "thor"
|
23
|
+
spec.add_dependency "hashie"
|
24
|
+
spec.add_dependency "colorize"
|
25
|
+
spec.add_dependency "aws-sdk"
|
26
|
+
|
27
|
+
# dependencies for vendor/aws-inventory
|
28
|
+
spec.add_dependency "activesupport"
|
29
|
+
spec.add_dependency "text-table"
|
30
|
+
spec.add_dependency "facets"
|
31
|
+
spec.add_dependency "actionview"
|
32
|
+
spec.add_dependency "json"
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler"
|
35
|
+
spec.add_development_dependency "byebug"
|
36
|
+
spec.add_development_dependency "rake"
|
37
|
+
spec.add_development_dependency "guard"
|
38
|
+
spec.add_development_dependency "guard-bundler"
|
39
|
+
spec.add_development_dependency "guard-rspec"
|
40
|
+
end
|
data/exe/aws-clean
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Trap ^C
|
4
|
+
Signal.trap("INT") {
|
5
|
+
puts "\nCtrl-C detected. Exiting..."
|
6
|
+
sleep 1
|
7
|
+
exit
|
8
|
+
}
|
9
|
+
|
10
|
+
$:.unshift(File.expand_path("../../lib", __FILE__))
|
11
|
+
require "aws-clean"
|
12
|
+
require "aws_clean/cli"
|
13
|
+
|
14
|
+
AwsClean::CLI.start(ARGV)
|
data/lib/aws-clean.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
$:.unshift(File.expand_path("../", __FILE__))
|
2
|
+
require "aws_clean/version"
|
3
|
+
|
4
|
+
# Use vendor version for quicker development and allows different submodules
|
5
|
+
# in parent project.
|
6
|
+
$:.unshift(File.expand_path("../../vendor/aws-inventory/lib", __FILE__))
|
7
|
+
require "aws-inventory"
|
8
|
+
|
9
|
+
module AwsClean
|
10
|
+
autoload :Help, "aws_clean/help"
|
11
|
+
autoload :Command, "aws_clean/command"
|
12
|
+
autoload :CLI, "aws_clean/cli"
|
13
|
+
autoload :Base, "aws_clean/base"
|
14
|
+
autoload :AwsServices, "aws_clean/aws_services"
|
15
|
+
autoload :SecurityGroup, "aws_clean/security_group"
|
16
|
+
autoload :Keypair, "aws_clean/keypair"
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Child class must implement this interface.
|
2
|
+
# Methods:
|
3
|
+
# clean - removes resources. This method should use the are_you_sure? method to
|
4
|
+
# prompt the user before deleting.
|
5
|
+
class AwsClean::Base
|
6
|
+
include AwsClean::AwsServices
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
@options = options
|
10
|
+
end
|
11
|
+
|
12
|
+
def are_you_sure?(message)
|
13
|
+
return false if ENV['TEST']
|
14
|
+
return true if @options[:sure]
|
15
|
+
puts message
|
16
|
+
|
17
|
+
puts "Are you sure? (yes/no)"
|
18
|
+
yes = $stdin.gets
|
19
|
+
yes =~ /yes/
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module AwsClean
|
2
|
+
class CLI < Command
|
3
|
+
class_option :verbose, type: :boolean
|
4
|
+
class_option :sure, type: :boolean
|
5
|
+
|
6
|
+
desc "sg", "clean unused security groups"
|
7
|
+
long_desc Help.text(:sg)
|
8
|
+
def sg
|
9
|
+
SecurityGroup.new(options).clean
|
10
|
+
end
|
11
|
+
|
12
|
+
desc "keypair", "clean unused keypairs"
|
13
|
+
long_desc Help.text(:keypair)
|
14
|
+
def keypair
|
15
|
+
Keypair.new(options).clean
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "thor"
|
2
|
+
|
3
|
+
module AwsClean
|
4
|
+
class Command < Thor
|
5
|
+
class << self
|
6
|
+
def dispatch(m, args, options, config)
|
7
|
+
# Allow calling for help via:
|
8
|
+
# aws_clean command help
|
9
|
+
# aws_clean command -h
|
10
|
+
# aws_clean command --help
|
11
|
+
# aws_clean command -D
|
12
|
+
#
|
13
|
+
# as well thor's normal way:
|
14
|
+
#
|
15
|
+
# aws_clean help command
|
16
|
+
help_flags = Thor::HELP_MAPPINGS + ["help"]
|
17
|
+
if args.length > 1 && !(args & help_flags).empty?
|
18
|
+
args -= help_flags
|
19
|
+
args.insert(-2, "help")
|
20
|
+
end
|
21
|
+
super
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'pp'
|
2
|
+
|
3
|
+
class AwsClean::Keypair < AwsClean::Base
|
4
|
+
def clean
|
5
|
+
return if ENV['TEST'] # hack for specs
|
6
|
+
|
7
|
+
inventory = AwsInventory::Keypair.new(header: false)
|
8
|
+
inventory.data.each do |row|
|
9
|
+
key_name, instances_count = row
|
10
|
+
in_use = instances_count > 0
|
11
|
+
next if in_use
|
12
|
+
|
13
|
+
sure = are_you_sure?("About to keypair #{key_name}")
|
14
|
+
if sure
|
15
|
+
ec2.delete_key_pair(key_name: key_name)
|
16
|
+
puts "Deleted #{key_name}"
|
17
|
+
else
|
18
|
+
puts "Did not delete #{key_name}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class AwsClean::SecurityGroup < AwsClean::Base
|
2
|
+
def clean
|
3
|
+
return if ENV['TEST'] # hack for specs
|
4
|
+
|
5
|
+
inventory = AwsInventory::SecurityGroup::Unused.new(report: 'unused', header: false)
|
6
|
+
inventory.data.each do |row|
|
7
|
+
group_name, group_id = row
|
8
|
+
next if group_name == "default" # skip the default group
|
9
|
+
|
10
|
+
friendly_name = "#{group_id} (#{group_name})"
|
11
|
+
|
12
|
+
sure = are_you_sure?("About to delete security group #{friendly_name}")
|
13
|
+
if sure
|
14
|
+
ec2.delete_security_group(group_id: group_id)
|
15
|
+
puts "Deleted #{friendly_name}"
|
16
|
+
else
|
17
|
+
puts "Did not delete #{friendly_name}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe AwsClean::CLI do
|
4
|
+
before(:all) do
|
5
|
+
@args = ""
|
6
|
+
end
|
7
|
+
|
8
|
+
%w[
|
9
|
+
sg
|
10
|
+
keypair
|
11
|
+
].each do |command|
|
12
|
+
it command do
|
13
|
+
out = execute("exe/aws-clean #{command} #{@args}")
|
14
|
+
expect(out).to eq ""
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
ENV["TEST"] = "1"
|
2
|
+
# Ensures aws api never called. Fixture home folder does not contain ~/.aws/credentails
|
3
|
+
ENV['HOME'] = "spec/fixtures/home"
|
4
|
+
|
5
|
+
# require "simplecov"
|
6
|
+
# SimpleCov.start
|
7
|
+
|
8
|
+
require "pp"
|
9
|
+
|
10
|
+
root = File.expand_path("../../", __FILE__)
|
11
|
+
require "#{root}/lib/aws-clean"
|
12
|
+
|
13
|
+
module Helpers
|
14
|
+
def execute(cmd)
|
15
|
+
puts "Running: #{cmd}" if ENV["DEBUG"]
|
16
|
+
out = `#{cmd}`
|
17
|
+
puts out if ENV["DEBUG"]
|
18
|
+
out
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
RSpec.configure do |c|
|
23
|
+
c.include Helpers
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,282 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aws-clean
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tung Nguyen
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: hashie
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: colorize
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: aws-sdk
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activesupport
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: text-table
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: facets
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: actionview
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: json
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: bundler
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: byebug
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rake
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: guard
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: guard-bundler
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: guard-rspec
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
description: AWS clean tool
|
224
|
+
email:
|
225
|
+
- tongueroo@gmail.com
|
226
|
+
executables:
|
227
|
+
- aws-clean
|
228
|
+
extensions: []
|
229
|
+
extra_rdoc_files: []
|
230
|
+
files:
|
231
|
+
- ".gitignore"
|
232
|
+
- ".gitmodules"
|
233
|
+
- ".rspec"
|
234
|
+
- CHANGELOG.md
|
235
|
+
- Gemfile
|
236
|
+
- Gemfile.lock
|
237
|
+
- Guardfile
|
238
|
+
- LICENSE.txt
|
239
|
+
- README.md
|
240
|
+
- Rakefile
|
241
|
+
- aws-clean.gemspec
|
242
|
+
- exe/aws-clean
|
243
|
+
- lib/aws-clean.rb
|
244
|
+
- lib/aws_clean/aws_services.rb
|
245
|
+
- lib/aws_clean/base.rb
|
246
|
+
- lib/aws_clean/cli.rb
|
247
|
+
- lib/aws_clean/command.rb
|
248
|
+
- lib/aws_clean/help.rb
|
249
|
+
- lib/aws_clean/help/keypair.md
|
250
|
+
- lib/aws_clean/help/sg.md
|
251
|
+
- lib/aws_clean/keypair.rb
|
252
|
+
- lib/aws_clean/security_group.rb
|
253
|
+
- lib/aws_clean/version.rb
|
254
|
+
- spec/lib/cli_spec.rb
|
255
|
+
- spec/spec_helper.rb
|
256
|
+
homepage: https://github.com/tongueroo/aws-clean
|
257
|
+
licenses:
|
258
|
+
- MIT
|
259
|
+
metadata: {}
|
260
|
+
post_install_message:
|
261
|
+
rdoc_options: []
|
262
|
+
require_paths:
|
263
|
+
- lib
|
264
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
265
|
+
requirements:
|
266
|
+
- - ">="
|
267
|
+
- !ruby/object:Gem::Version
|
268
|
+
version: '0'
|
269
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
|
+
requirements:
|
271
|
+
- - ">="
|
272
|
+
- !ruby/object:Gem::Version
|
273
|
+
version: '0'
|
274
|
+
requirements: []
|
275
|
+
rubyforge_project:
|
276
|
+
rubygems_version: 2.6.14
|
277
|
+
signing_key:
|
278
|
+
specification_version: 4
|
279
|
+
summary: AWS clean tool
|
280
|
+
test_files:
|
281
|
+
- spec/lib/cli_spec.rb
|
282
|
+
- spec/spec_helper.rb
|