traceroute53 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d14ec1cd7f7bd6d16e0a1cf3e68680ce364852269e3e26cee6148af18cdde960
4
- data.tar.gz: 6d75e452eb15b4bc1936aaa7086e1bd51ec2bc9dc7c25f4c37f064686eea0ced
3
+ metadata.gz: d55232ad71eb5f5decdc7eb2c619ceb1474b3f36131da40ee319142cfefa2fbc
4
+ data.tar.gz: 59fecd8ce6c98b5ba84f242b54a0e02f133a69cfb1b759b5668f487a61e01b19
5
5
  SHA512:
6
- metadata.gz: ed37b10833cd4e6cb866dcfe2bb20b3e9dd5a1225104df91920519e0ac9ba5f021e8cb218812eafcc02ee9bb8650e26c75ebe07156c6657e4b06e87bdeed0943
7
- data.tar.gz: 575dcae80e93269651904cba2e5c78ab63c5f2967376edc8d5ba570178b34dab7bc66deb776784e6fe54faa21d6a1a7a0bbeed8aea027f2d8173180c8e635441
6
+ metadata.gz: 2b75ae1d67d4b603e7181a3495a6922fcba215e65c6ceb1aca9777a2b08bc8c06a1be371f265830778b3092aea304eca4e16c6ea45fb507495074f870627b85b
7
+ data.tar.gz: 1d69b8b9457c473c6c405abc16d48affef8cd9ab8f8258e665035f3006adbe5ca094a6e7b89fb08701dbf03df66966b3a706b58cffe1c8acb88ab066f2646c7e
data/README.md CHANGED
@@ -2,26 +2,64 @@
2
2
 
3
3
  A tool to investigate Route53, ELB, EC2 and Security Groups
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/traceroute53.svg)](https://badge.fury.io/rb/traceroute53)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
8
10
 
9
11
  ```ruby
10
- gem 'traceroute53'
12
+ gem install traceroute53
11
13
  ```
12
14
 
13
- And then execute:
15
+ ## Usage
14
16
 
15
- $ bundle
17
+ ```
18
+ traceroute53 <domain>
19
+ ```
16
20
 
17
- Or install it yourself as:
21
+ To pass credentials, [set environment variables](https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html#aws-ruby-sdk-credentials-environment) or speicfy `--profile=PROFILE` option.
18
22
 
19
- $ gem install traceroute53
23
+ ### An example for healthy domain
20
24
 
21
- ## Usage
25
+ Below is an example for healty domain. It show the ELB has a target instance and it can foward requests to it. Because the security group associated the instance allows LB's security group.
22
26
 
23
27
  ```
24
- traceroute53 <domain>
28
+ % traceroute53 foo-development.example.com
29
+ hosted zone: example.com.
30
+ dns name: internal-foo-aws-1-123456.us-east-1.elb.amazonaws.com.
31
+ load balancer: foo-aws-1 ["sg-0aaaaaaaaaaaaaa1", "sg-ccccccccccccccccc"]
32
+ listener[0]: port:443 arn:aws:elasticloadbalancing:us-east-1:567890123456:listener/app/foo-aws-1/7890123456789abc/0cdef01234567789
33
+ listener[0]action[0]: forward arn:aws:elasticloadbalancing:us-east-1:567890123456:targetgroup/foo-aws-1/89abcdef01234567
34
+ listener[0]action[0]target[0]: i-0cdef0123456789ab:8080 healthy
35
+ group_ids[0]: ["sg-09988776655443322", "sg-39393939"]
36
+ group_ids[0]sg[0]: sg-09988776655443322
37
+ group_ids[0]sg[0]ip[0]: port:8080 ["sg-ccccccccccccccccc"]
38
+ group_ids[0]sg[0]ip[1]: port:22 ["sg-05566778899aabbcc", "sg-f8e8d8c8"]
39
+ group_ids[0]sg[1]: sg-39393939
40
+ group_ids[0]sg[1]ip[0]: port:8080 ["sg-11223344"]
41
+ group_ids[0]sg[1]ip[1]: port:nil ["sg-f8f8f8f8"]
42
+ group_ids[0]sg[1]ip[2]: port:22 ["sg-33886655"]
43
+ ```
44
+
45
+ ### An example for unhealthy domain
46
+
47
+ In this example Route53's hosted zone correctly have dns resource, which has correct dns\_name, listener, target group but its 2nd security group's Permission set is empty.
48
+
49
+ ```
50
+ % traceroute53 bar-blah.example.com
51
+ hosted zone: example.com.
52
+ dns name: internal-bar-blah-aws-tokyo-1-999888333.ap-northeast-1.elb.amazonaws.com.
53
+ load balancer: bar-blah-aws-tokyo-1 ["sg-0eeddccbbaa998877", "sg-06665554443332221"]
54
+ listener[0]: port:443 arn:aws:elasticloadbalancing:ap-northeast-1:567890123456:listener/app/bar-blah-aws-tokyo-1/ef0123456789abcd/cccaaabbb9996667
55
+ listener[0]action[0]: forward arn:aws:elasticloadbalancing:ap-northeast-1:567890123456:targetgroup/bar-blah-atyo-1/fedcba9876543210
56
+ listener[0]action[0]target[0]: i-0cc123456789abcd:8080 unhealthy
57
+ group_ids[0]: ["sg-c57c55cc", "sg-0336699ccff003366"]
58
+ group_ids[0]sg[0]: sg-c57c55cc
59
+ group_ids[0]sg[0]ip[0]: port:8080 ["sg-99776655"]
60
+ group_ids[0]sg[0]ip[1]: port:nil ["sg-11335577"]
61
+ group_ids[0]sg[0]ip[2]: port:22 ["sg-fe87dc65"]
62
+ group_ids[0]sg[1]: sg-0336699ccff003366
25
63
  ```
26
64
 
27
65
  ## Development
data/exe/traceroute53 CHANGED
@@ -103,10 +103,18 @@ def describe_instances(client, instance_ids)
103
103
  end
104
104
 
105
105
  def describe_security_groups(client, group_ids)
106
- resp = client.describe_security_groups({
107
- group_ids: group_ids,
108
- })
109
- resp.security_groups
106
+ marker = nil
107
+ security_groups = []
108
+ loop do
109
+ resp = client.describe_security_groups({
110
+ group_ids: group_ids,
111
+ next_token: marker,
112
+ })
113
+ security_groups.concat resp.security_groups
114
+ marker = resp.next_token
115
+ break unless marker
116
+ end
117
+ security_groups
110
118
  end
111
119
 
112
120
  def describe_target_health(client, target_group_arn)
@@ -1,3 +1,3 @@
1
1
  module Traceroute53
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/traceroute53.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["naruse@airemix.jp"]
11
11
 
12
12
  spec.summary = %q{A tool to investigate Route53, ELB, EC2 and Security Groups}
13
- spec.description = %q{An tool to investigate Route53, ELB, EC2 and Security Groups}
13
+ spec.description = %q{A tool to investigate Route53, ELB, EC2 and Security Groups}
14
14
  spec.homepage = "https://github.com/nurse/traceroute53"
15
15
  spec.license = "MIT"
16
16
 
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
37
  spec.require_paths = ["lib"]
38
38
 
39
+ spec.add_dependency "aws-sdk", "~> 3"
39
40
  spec.add_development_dependency "bundler", "~> 1.17"
40
41
  spec.add_development_dependency "rake", "~> 10.0"
41
42
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traceroute53
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - NARUSE, Yui
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-07 00:00:00.000000000 Z
11
+ date: 2019-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +66,7 @@ dependencies:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '3.0'
55
- description: An tool to investigate Route53, ELB, EC2 and Security Groups
69
+ description: A tool to investigate Route53, ELB, EC2 and Security Groups
56
70
  email:
57
71
  - naruse@airemix.jp
58
72
  executables: