aws-inventory 0.3.2 → 0.4.0
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/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/{inventory.gemspec → aws_inventory.gemspec} +2 -2
- data/exe/aws-inventory +3 -3
- data/lib/aws_inventory.rb +27 -0
- data/lib/{inventory → aws_inventory}/acm.rb +1 -1
- data/lib/{inventory → aws_inventory}/aws_services.rb +2 -2
- data/lib/{inventory → aws_inventory}/base.rb +6 -6
- data/lib/{inventory → aws_inventory}/cfn.rb +1 -1
- data/lib/{inventory → aws_inventory}/cli.rb +2 -1
- data/lib/{inventory → aws_inventory}/cloudwatch.rb +1 -1
- data/lib/{inventory → aws_inventory}/command.rb +6 -6
- data/lib/{inventory → aws_inventory}/eb.rb +1 -1
- data/lib/{inventory → aws_inventory}/ec2.rb +1 -1
- data/lib/aws_inventory/ecs.rb +10 -0
- data/lib/{inventory → aws_inventory}/ecs/cluster.rb +1 -1
- data/lib/{inventory → aws_inventory}/ecs/service.rb +1 -1
- data/lib/{inventory → aws_inventory}/elb.rb +4 -4
- data/lib/{inventory → aws_inventory}/help.rb +1 -1
- data/lib/{inventory → aws_inventory}/help/acm.md +0 -0
- data/lib/{inventory → aws_inventory}/help/cfn.md +0 -0
- data/lib/{inventory → aws_inventory}/help/cw.md +0 -0
- data/lib/{inventory → aws_inventory}/help/eb.md +0 -0
- data/lib/{inventory → aws_inventory}/help/ec2.md +0 -0
- data/lib/{inventory → aws_inventory}/help/ecs.md +0 -0
- data/lib/{inventory → aws_inventory}/help/elb.md +0 -0
- data/lib/aws_inventory/help/iam.md +15 -0
- data/lib/{inventory → aws_inventory}/help/keypair.md +0 -0
- data/lib/aws_inventory/help/rds.md +5 -0
- data/lib/{inventory → aws_inventory}/help/sg.md +0 -0
- data/lib/{inventory → aws_inventory}/help/vpc.md +0 -0
- data/lib/{inventory → aws_inventory}/iam.rb +5 -5
- data/lib/{inventory → aws_inventory}/iam/group.rb +2 -2
- data/lib/{inventory → aws_inventory}/iam/shared.rb +1 -1
- data/lib/{inventory → aws_inventory}/iam/summary.rb +2 -2
- data/lib/{inventory → aws_inventory}/iam/user.rb +2 -2
- data/lib/{inventory → aws_inventory}/keypair.rb +1 -1
- data/lib/aws_inventory/presenter.rb +22 -0
- data/lib/aws_inventory/presenters/base.rb +10 -0
- data/lib/aws_inventory/presenters/json.rb +11 -0
- data/lib/aws_inventory/presenters/tab.rb +7 -0
- data/lib/aws_inventory/presenters/table.rb +10 -0
- data/lib/{inventory → aws_inventory}/rds.rb +4 -4
- data/lib/{inventory → aws_inventory}/rds/port.rb +2 -2
- data/lib/{inventory → aws_inventory}/rds/shared.rb +3 -3
- data/lib/{inventory → aws_inventory}/rds/summary.rb +2 -2
- data/lib/{inventory → aws_inventory}/route53.rb +1 -1
- data/lib/aws_inventory/security_group.rb +13 -0
- data/lib/{inventory → aws_inventory}/security_group/open.rb +2 -2
- data/lib/{inventory → aws_inventory}/security_group/shared.rb +1 -1
- data/lib/{inventory → aws_inventory}/security_group/summary.rb +2 -2
- data/lib/{inventory → aws_inventory}/security_group/unused.rb +2 -2
- data/lib/{inventory → aws_inventory}/shared.rb +1 -1
- data/lib/aws_inventory/version.rb +3 -0
- data/lib/{inventory → aws_inventory}/vpc.rb +1 -1
- data/spec/lib/aws_inventory/base_spec.rb +7 -0
- data/spec/lib/{inventory → aws_inventory}/security_group/open_spec.rb +2 -2
- data/spec/lib/cli_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +58 -58
- data/lib/inventory.rb +0 -27
- data/lib/inventory/ecs.rb +0 -10
- data/lib/inventory/help/iam.md +0 -15
- data/lib/inventory/help/rds.md +0 -5
- data/lib/inventory/presenter.rb +0 -21
- data/lib/inventory/presenters/base.rb +0 -5
- data/lib/inventory/presenters/json.rb +0 -11
- data/lib/inventory/presenters/tab.rb +0 -7
- data/lib/inventory/presenters/table.rb +0 -10
- data/lib/inventory/security_group.rb +0 -13
- data/lib/inventory/version.rb +0 -3
- data/spec/lib/inventory/base_spec.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 499ffb69b91d22febfa998f60dbcae85addfb9f8
|
4
|
+
data.tar.gz: 2a834b23c194b0dddbaa45c7192aea4e5d3fb014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a9f593124dc37d879df905fbca16c3cffcf73e5fe1d26dd757bb48b92e65523b6213711d7017b36bcfe2f3f4dbf92fa6266db7fb280fa1e5c3d84c95d9630b
|
7
|
+
data.tar.gz: f100bc493a36ece7b2ba49039fcd2313de01616f028d71778028187b19472208e734f470df6e720facdea743b6da36c25f4d1fa027ae66dfcf0cbe25181c31ed
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.4.0]
|
7
|
+
* rename Inventory module to AwsInventory
|
8
|
+
* add --no-header support
|
9
|
+
|
6
10
|
## [0.3.2]
|
7
11
|
* fix unused security group report
|
8
12
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# AWS
|
1
|
+
# AWS AwsInventory
|
2
2
|
|
3
|
-
AWS
|
3
|
+
AWS AwsInventory tool. Useful to get summarized information on AWS account. The tool by default produces a report that can easily be read from a terminal, but it can also be used produce a tab separated output report that can be pasted into a spreadsheet and then copied to a report. This is controlled via a `AWS_INVENTORY_FORMAT` env variable and covered in the Format Options section.
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
```sh
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "
|
4
|
+
require "aws_inventory/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "aws-inventory"
|
8
|
-
spec.version =
|
8
|
+
spec.version = AwsInventory::VERSION
|
9
9
|
spec.authors = ["Tung Nguyen"]
|
10
10
|
spec.email = ["tongueroo@gmail.com"]
|
11
11
|
spec.description = %q{Tool to inventory AWS account}
|
data/exe/aws-inventory
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
$:.unshift(File.expand_path("../", __FILE__))
|
2
|
+
require "aws_inventory/version"
|
3
|
+
require "text-table"
|
4
|
+
require "active_support/all"
|
5
|
+
|
6
|
+
module AwsInventory
|
7
|
+
autoload :Base, "aws_inventory/base"
|
8
|
+
autoload :Help, "aws_inventory/help"
|
9
|
+
autoload :Command, "aws_inventory/command"
|
10
|
+
autoload :CLI, "aws_inventory/cli"
|
11
|
+
autoload :AwsServices, "aws_inventory/aws_services"
|
12
|
+
autoload :Shared, "aws_inventory/shared"
|
13
|
+
autoload :Presenter, "aws_inventory/presenter"
|
14
|
+
autoload :Cfn, "aws_inventory/cfn"
|
15
|
+
autoload :Ec2, "aws_inventory/ec2"
|
16
|
+
autoload :Vpc, "aws_inventory/vpc"
|
17
|
+
autoload :SecurityGroup, "aws_inventory/security_group"
|
18
|
+
autoload :Rds, "aws_inventory/rds"
|
19
|
+
autoload :Route53, "aws_inventory/route53"
|
20
|
+
autoload :Acm, "aws_inventory/acm"
|
21
|
+
autoload :Elb, "aws_inventory/elb"
|
22
|
+
autoload :Eb, "aws_inventory/eb"
|
23
|
+
autoload :Ecs, "aws_inventory/ecs"
|
24
|
+
autoload :Keypair, "aws_inventory/keypair"
|
25
|
+
autoload :Iam, "aws_inventory/iam"
|
26
|
+
autoload :Cloudwatch, "aws_inventory/cloudwatch"
|
27
|
+
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
# header - header row to display. Array of strings.
|
4
4
|
# data - data to display under header. 2D Array.
|
5
5
|
# Each item in the array represents a row of data.
|
6
|
-
class
|
7
|
-
include
|
6
|
+
class AwsInventory::Base
|
7
|
+
include AwsInventory::AwsServices
|
8
8
|
|
9
9
|
def initialize(options)
|
10
10
|
@options = options
|
@@ -15,7 +15,7 @@ class Inventory::Base
|
|
15
15
|
|
16
16
|
results = sort(data)
|
17
17
|
results.unshift(header) if header
|
18
|
-
presenter =
|
18
|
+
presenter = AwsInventory::Presenter.new(@options, results)
|
19
19
|
presenter.display
|
20
20
|
end
|
21
21
|
|
@@ -61,11 +61,11 @@ class Inventory::Base
|
|
61
61
|
|
62
62
|
class_name = path
|
63
63
|
.sub('.rb','')
|
64
|
-
.sub(%r{.*/
|
64
|
+
.sub(%r{.*/aws_inventory}, 'aws_inventory')
|
65
65
|
.camelize
|
66
66
|
# special rules
|
67
|
-
class_name.sub
|
68
|
-
|
67
|
+
class_name = class_name.sub("Cli", "CLI")
|
68
|
+
.sub('Presenters', 'Presenter')
|
69
69
|
|
70
70
|
class_name.constantize # use constantize instead of require
|
71
71
|
# so we dont have to worry about require order.
|
@@ -1,18 +1,18 @@
|
|
1
1
|
require "thor"
|
2
2
|
|
3
|
-
module
|
3
|
+
module AwsInventory
|
4
4
|
class Command < Thor
|
5
5
|
class << self
|
6
6
|
def dispatch(m, args, options, config)
|
7
7
|
# Allow calling for help via:
|
8
|
-
# inventory command help
|
9
|
-
# inventory command -h
|
10
|
-
# inventory command --help
|
11
|
-
# inventory command -D
|
8
|
+
# aws-inventory command help
|
9
|
+
# aws-inventory command -h
|
10
|
+
# aws-inventory command --help
|
11
|
+
# aws-inventory command -D
|
12
12
|
#
|
13
13
|
# as well thor's normal way:
|
14
14
|
#
|
15
|
-
# inventory help command
|
15
|
+
# aws-inventory help command
|
16
16
|
help_flags = Thor::HELP_MAPPINGS + ["help"]
|
17
17
|
if args.length > 1 && !(args & help_flags).empty?
|
18
18
|
args -= help_flags
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class AwsInventory::Elb < AwsInventory::Base
|
2
2
|
def header
|
3
3
|
["ELB", "Type", "Security Group", "Open Ports"]
|
4
4
|
end
|
@@ -60,12 +60,12 @@ class Inventory::Elb < Inventory::Base
|
|
60
60
|
end
|
61
61
|
|
62
62
|
# Returns an Array of ports with a cidr of 0.0.0.0/0
|
63
|
-
# Delegates to
|
63
|
+
# Delegates to AwsInventory::SecurityGroup
|
64
64
|
def open_ports(group_id)
|
65
65
|
sg = security_groups.find { |sg| sg.group_id == group_id }
|
66
66
|
return unless sg
|
67
67
|
|
68
|
-
|
69
|
-
|
68
|
+
aws_inventory = AwsInventory::SecurityGroup::Open.new(@options)
|
69
|
+
aws_inventory.ports_open_to_world(sg)
|
70
70
|
end
|
71
71
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Reports the IAM inventory.
|
2
|
+
|
3
|
+
List of groups and users in the groups:
|
4
|
+
|
5
|
+
$ aws-inventory iam --report groups # this is the default
|
6
|
+
|
7
|
+
$ aws-inventory iam # same as above
|
8
|
+
|
9
|
+
List of the users and their groups:
|
10
|
+
|
11
|
+
$ aws-inventory iam --report users
|
12
|
+
|
13
|
+
Summary of number of groups and users
|
14
|
+
|
15
|
+
$ aws-inventory iam --report summary
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class
|
2
|
-
autoload :Shared, "
|
3
|
-
autoload :Summary, "
|
4
|
-
autoload :User, "
|
5
|
-
autoload :Group, "
|
1
|
+
class AwsInventory::Iam < AwsInventory::Base
|
2
|
+
autoload :Shared, "aws_inventory/iam/shared"
|
3
|
+
autoload :Summary, "aws_inventory/iam/summary"
|
4
|
+
autoload :User, "aws_inventory/iam/user"
|
5
|
+
autoload :Group, "aws_inventory/iam/group"
|
6
6
|
|
7
7
|
# Default is the groups report because it seems like the most useful report
|
8
8
|
def report
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class AwsInventory::Presenter
|
2
|
+
autoload :Base, "aws_inventory/presenters/base"
|
3
|
+
autoload :Tab, "aws_inventory/presenters/tab"
|
4
|
+
autoload :Table, "aws_inventory/presenters/table"
|
5
|
+
autoload :Json, "aws_inventory/presenters/json"
|
6
|
+
|
7
|
+
def initialize(options, data)
|
8
|
+
@options = options
|
9
|
+
@data = data
|
10
|
+
end
|
11
|
+
|
12
|
+
def display
|
13
|
+
presenter_class = "AwsInventory::Presenter::#{format.classify}".constantize
|
14
|
+
presenter = presenter_class.new(@options, @data)
|
15
|
+
presenter.display
|
16
|
+
end
|
17
|
+
|
18
|
+
# Formats: tabs, markdown
|
19
|
+
def format
|
20
|
+
ENV['AWS_INVENTORY_FORMAT'] || "table"
|
21
|
+
end
|
22
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
class
|
2
|
-
autoload :Shared, "
|
3
|
-
autoload :Summary, "
|
4
|
-
autoload :Port, "
|
1
|
+
class AwsInventory::Rds < AwsInventory::Base
|
2
|
+
autoload :Shared, "aws_inventory/rds/shared"
|
3
|
+
autoload :Summary, "aws_inventory/rds/summary"
|
4
|
+
autoload :Port, "aws_inventory/rds/port"
|
5
5
|
|
6
6
|
# Default is the open report because it seems like the most useful report
|
7
7
|
def report
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module AwsInventory::Rds::Shared
|
2
2
|
# pretty name of vpc
|
3
3
|
def vpc_name(db)
|
4
4
|
group_ids = db.vpc_security_groups.map(&:vpc_security_group_id)
|
@@ -12,8 +12,8 @@ module Inventory::Rds::Shared
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def lookup_vpc_name(vpc_id)
|
15
|
-
|
16
|
-
|
15
|
+
aws_inventory_vpc = AwsInventory::Vpc.new(@options)
|
16
|
+
aws_inventory_vpc.vpc_name(vpc_id)
|
17
17
|
end
|
18
18
|
|
19
19
|
def vpcs
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AwsInventory::SecurityGroup < AwsInventory::Base
|
2
|
+
autoload :Shared, "aws_inventory/security_group/shared"
|
3
|
+
autoload :Summary, "aws_inventory/security_group/summary"
|
4
|
+
autoload :Open, "aws_inventory/security_group/open"
|
5
|
+
autoload :Unused, "aws_inventory/security_group/unused"
|
6
|
+
|
7
|
+
# Default is the open report because it seems like the most useful report
|
8
|
+
def report
|
9
|
+
Summary.new(@options).report if show(:summary)
|
10
|
+
Open.new(@options).report if show(:open)
|
11
|
+
Unused.new(@options).report if show(:unused)
|
12
|
+
end
|
13
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe
|
4
|
-
let(:reporter) {
|
3
|
+
describe AwsInventory::SecurityGroup::Open do
|
4
|
+
let(:reporter) { AwsInventory::SecurityGroup::Open.new({}) }
|
5
5
|
|
6
6
|
it "combine_ports" do
|
7
7
|
ports = [22]
|
data/spec/lib/cli_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-inventory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -237,62 +237,62 @@ files:
|
|
237
237
|
- LICENSE.txt
|
238
238
|
- README.md
|
239
239
|
- Rakefile
|
240
|
+
- aws_inventory.gemspec
|
240
241
|
- exe/aws-inventory
|
241
|
-
-
|
242
|
-
- lib/
|
243
|
-
- lib/
|
244
|
-
- lib/
|
245
|
-
- lib/
|
246
|
-
- lib/
|
247
|
-
- lib/
|
248
|
-
- lib/
|
249
|
-
- lib/
|
250
|
-
- lib/
|
251
|
-
- lib/
|
252
|
-
- lib/
|
253
|
-
- lib/
|
254
|
-
- lib/
|
255
|
-
- lib/
|
256
|
-
- lib/
|
257
|
-
- lib/
|
258
|
-
- lib/
|
259
|
-
- lib/
|
260
|
-
- lib/
|
261
|
-
- lib/
|
262
|
-
- lib/
|
263
|
-
- lib/
|
264
|
-
- lib/
|
265
|
-
- lib/
|
266
|
-
- lib/
|
267
|
-
- lib/
|
268
|
-
- lib/
|
269
|
-
- lib/
|
270
|
-
- lib/
|
271
|
-
- lib/
|
272
|
-
- lib/
|
273
|
-
- lib/
|
274
|
-
- lib/
|
275
|
-
- lib/
|
276
|
-
- lib/
|
277
|
-
- lib/
|
278
|
-
- lib/
|
279
|
-
- lib/
|
280
|
-
- lib/
|
281
|
-
- lib/
|
282
|
-
- lib/
|
283
|
-
- lib/
|
284
|
-
- lib/
|
285
|
-
- lib/
|
286
|
-
- lib/
|
287
|
-
- lib/
|
288
|
-
- lib/
|
289
|
-
- lib/
|
290
|
-
- lib/
|
291
|
-
- lib/
|
292
|
-
- lib/
|
242
|
+
- lib/aws_inventory.rb
|
243
|
+
- lib/aws_inventory/acm.rb
|
244
|
+
- lib/aws_inventory/aws_services.rb
|
245
|
+
- lib/aws_inventory/base.rb
|
246
|
+
- lib/aws_inventory/cfn.rb
|
247
|
+
- lib/aws_inventory/cli.rb
|
248
|
+
- lib/aws_inventory/cloudwatch.rb
|
249
|
+
- lib/aws_inventory/command.rb
|
250
|
+
- lib/aws_inventory/eb.rb
|
251
|
+
- lib/aws_inventory/ec2.rb
|
252
|
+
- lib/aws_inventory/ecs.rb
|
253
|
+
- lib/aws_inventory/ecs/cluster.rb
|
254
|
+
- lib/aws_inventory/ecs/service.rb
|
255
|
+
- lib/aws_inventory/elb.rb
|
256
|
+
- lib/aws_inventory/help.rb
|
257
|
+
- lib/aws_inventory/help/acm.md
|
258
|
+
- lib/aws_inventory/help/cfn.md
|
259
|
+
- lib/aws_inventory/help/cw.md
|
260
|
+
- lib/aws_inventory/help/eb.md
|
261
|
+
- lib/aws_inventory/help/ec2.md
|
262
|
+
- lib/aws_inventory/help/ecs.md
|
263
|
+
- lib/aws_inventory/help/elb.md
|
264
|
+
- lib/aws_inventory/help/iam.md
|
265
|
+
- lib/aws_inventory/help/keypair.md
|
266
|
+
- lib/aws_inventory/help/rds.md
|
267
|
+
- lib/aws_inventory/help/sg.md
|
268
|
+
- lib/aws_inventory/help/vpc.md
|
269
|
+
- lib/aws_inventory/iam.rb
|
270
|
+
- lib/aws_inventory/iam/group.rb
|
271
|
+
- lib/aws_inventory/iam/shared.rb
|
272
|
+
- lib/aws_inventory/iam/summary.rb
|
273
|
+
- lib/aws_inventory/iam/user.rb
|
274
|
+
- lib/aws_inventory/keypair.rb
|
275
|
+
- lib/aws_inventory/presenter.rb
|
276
|
+
- lib/aws_inventory/presenters/base.rb
|
277
|
+
- lib/aws_inventory/presenters/json.rb
|
278
|
+
- lib/aws_inventory/presenters/tab.rb
|
279
|
+
- lib/aws_inventory/presenters/table.rb
|
280
|
+
- lib/aws_inventory/rds.rb
|
281
|
+
- lib/aws_inventory/rds/port.rb
|
282
|
+
- lib/aws_inventory/rds/shared.rb
|
283
|
+
- lib/aws_inventory/rds/summary.rb
|
284
|
+
- lib/aws_inventory/route53.rb
|
285
|
+
- lib/aws_inventory/security_group.rb
|
286
|
+
- lib/aws_inventory/security_group/open.rb
|
287
|
+
- lib/aws_inventory/security_group/shared.rb
|
288
|
+
- lib/aws_inventory/security_group/summary.rb
|
289
|
+
- lib/aws_inventory/security_group/unused.rb
|
290
|
+
- lib/aws_inventory/shared.rb
|
291
|
+
- lib/aws_inventory/version.rb
|
292
|
+
- lib/aws_inventory/vpc.rb
|
293
|
+
- spec/lib/aws_inventory/base_spec.rb
|
294
|
+
- spec/lib/aws_inventory/security_group/open_spec.rb
|
293
295
|
- spec/lib/cli_spec.rb
|
294
|
-
- spec/lib/inventory/base_spec.rb
|
295
|
-
- spec/lib/inventory/security_group/open_spec.rb
|
296
296
|
- spec/spec_helper.rb
|
297
297
|
homepage: https://github.com/tongueroo/aws-inventory
|
298
298
|
licenses:
|
@@ -319,7 +319,7 @@ signing_key:
|
|
319
319
|
specification_version: 4
|
320
320
|
summary: Tool to inventory AWS account
|
321
321
|
test_files:
|
322
|
+
- spec/lib/aws_inventory/base_spec.rb
|
323
|
+
- spec/lib/aws_inventory/security_group/open_spec.rb
|
322
324
|
- spec/lib/cli_spec.rb
|
323
|
-
- spec/lib/inventory/base_spec.rb
|
324
|
-
- spec/lib/inventory/security_group/open_spec.rb
|
325
325
|
- spec/spec_helper.rb
|
data/lib/inventory.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
$:.unshift(File.expand_path("../", __FILE__))
|
2
|
-
require "inventory/version"
|
3
|
-
require "text-table"
|
4
|
-
require "active_support/all"
|
5
|
-
|
6
|
-
module Inventory
|
7
|
-
autoload :Base, "inventory/base"
|
8
|
-
autoload :Help, "inventory/help"
|
9
|
-
autoload :Command, "inventory/command"
|
10
|
-
autoload :CLI, "inventory/cli"
|
11
|
-
autoload :AwsServices, "inventory/aws_services"
|
12
|
-
autoload :Shared, "inventory/shared"
|
13
|
-
autoload :Presenter, "inventory/presenter"
|
14
|
-
autoload :Cfn, "inventory/cfn"
|
15
|
-
autoload :Ec2, "inventory/ec2"
|
16
|
-
autoload :Vpc, "inventory/vpc"
|
17
|
-
autoload :SecurityGroup, "inventory/security_group"
|
18
|
-
autoload :Rds, "inventory/rds"
|
19
|
-
autoload :Route53, "inventory/route53"
|
20
|
-
autoload :Acm, "inventory/acm"
|
21
|
-
autoload :Elb, "inventory/elb"
|
22
|
-
autoload :Eb, "inventory/eb"
|
23
|
-
autoload :Ecs, "inventory/ecs"
|
24
|
-
autoload :Keypair, "inventory/keypair"
|
25
|
-
autoload :Iam, "inventory/iam"
|
26
|
-
autoload :Cloudwatch, "inventory/cloudwatch"
|
27
|
-
end
|
data/lib/inventory/ecs.rb
DELETED
data/lib/inventory/help/iam.md
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
Reports the IAM inventory.
|
2
|
-
|
3
|
-
List of groups and users in the groups:
|
4
|
-
|
5
|
-
$ inventory iam --report groups # this is the default
|
6
|
-
|
7
|
-
$ inventory iam # same as above
|
8
|
-
|
9
|
-
List of the users and their groups:
|
10
|
-
|
11
|
-
$ inventory iam --report users
|
12
|
-
|
13
|
-
Summary of number of groups and users
|
14
|
-
|
15
|
-
$ inventory iam --report summary
|
data/lib/inventory/help/rds.md
DELETED
data/lib/inventory/presenter.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
class Inventory::Presenter
|
2
|
-
autoload :Base, "inventory/presenters/base"
|
3
|
-
autoload :Tab, "inventory/presenters/tab"
|
4
|
-
autoload :Table, "inventory/presenters/table"
|
5
|
-
autoload :Json, "inventory/presenters/json"
|
6
|
-
|
7
|
-
def initialize(data)
|
8
|
-
@data = data
|
9
|
-
end
|
10
|
-
|
11
|
-
def display
|
12
|
-
presenter_class = "Inventory::Presenter::#{format.classify}".constantize
|
13
|
-
presenter = presenter_class.new(@data)
|
14
|
-
presenter.display
|
15
|
-
end
|
16
|
-
|
17
|
-
# Formats: tabs, markdown
|
18
|
-
def format
|
19
|
-
ENV['AWS_INVENTORY_FORMAT'] || "table"
|
20
|
-
end
|
21
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class Inventory::SecurityGroup < Inventory::Base
|
2
|
-
autoload :Shared, "inventory/security_group/shared"
|
3
|
-
autoload :Summary, "inventory/security_group/summary"
|
4
|
-
autoload :Open, "inventory/security_group/open"
|
5
|
-
autoload :Unused, "inventory/security_group/unused"
|
6
|
-
|
7
|
-
# Default is the open report because it seems like the most useful report
|
8
|
-
def report
|
9
|
-
Summary.new(@options).report if show(:summary)
|
10
|
-
Open.new(@options).report if show(:open)
|
11
|
-
Unused.new(@options.report).report if show(:unused)
|
12
|
-
end
|
13
|
-
end
|
data/lib/inventory/version.rb
DELETED