aws-inventory 0.4.2 → 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/CHANGELOG.md +3 -0
- data/lib/aws_inventory/security_group/shared.rb +11 -2
- data/lib/aws_inventory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54f7eb62f72d45cf758bcae5ebab0ad2da793397
|
4
|
+
data.tar.gz: 2adba14a03a08557e60c2f33752f80c1383c8bd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55ed6c3db50420cf2b98731ad1f1f7074e8e8a66b1fd66e62d3728c229aab221c754e437e142ab9a09d58541779b4a3e4b2d79870644163fadf186ac3d659e17
|
7
|
+
data.tar.gz: 5da8014d494ea64e80cf7423d9370e7dca653e0fcd277212f64cc892a08b1adfe1ebacfdc73648661ff8975dd8a12fd76a6b333d0f1e10d640360378d614f6c5
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
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.3]
|
7
|
+
* account for elbs using security groups
|
8
|
+
|
6
9
|
## [0.4.2]
|
7
10
|
* sg unused report prints out group_id instead of vpc_id
|
8
11
|
|
@@ -1,10 +1,19 @@
|
|
1
1
|
module AwsInventory::SecurityGroup::Shared
|
2
2
|
def used_security_groups
|
3
3
|
groups = instances.inject([]) do |results, i|
|
4
|
-
results += i.security_groups
|
4
|
+
results += i.security_groups # returns Aws::EC2::Types::GroupIdentifier
|
5
5
|
results
|
6
6
|
end
|
7
|
-
groups.uniq(&:group_id)
|
7
|
+
instance_groups = groups.uniq(&:group_id)
|
8
|
+
|
9
|
+
v1_group_ids = elbv1.describe_load_balancers.load_balancer_descriptions.map(&:security_groups).flatten
|
10
|
+
v2_group_ids = elbv2.describe_load_balancers.load_balancers.map(&:security_groups).flatten
|
11
|
+
group_ids = v1_group_ids + v2_group_ids
|
12
|
+
elb_groups = ec2.describe_security_groups(group_ids: group_ids).security_groups # returns Aws::EC2::Types::SecurityGroup
|
13
|
+
|
14
|
+
# Ducktyping: the types are different by they both respond to the group_id method.
|
15
|
+
all_groups = instance_groups + elb_groups
|
16
|
+
all_groups.uniq(&:group_id)
|
8
17
|
end
|
9
18
|
|
10
19
|
def unused_security_groups
|
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.
|
4
|
+
version: 0.4.3
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|