traceroute53 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +2 -2
- data/exe/traceroute53 +21 -13
- data/lib/traceroute53/version.rb +1 -1
- data/traceroute53.gemspec +3 -1
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46c7a0ad8543b7757ba846d2f84f431364d17d97fcfc7f19bf4629c57ac2d91b
|
4
|
+
data.tar.gz: 5abf1885fb224a19aa858b7ecb221a9e3a751db0412f856f355e654e9d60e651
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d57b5cf0e312ea84927b3f6c556231dcba7dee9ed9298ddc8fe4db1051ed2b35dd5318c97a87913b47c31b4b8e6a57c112d5b2574137204a8c3ded3914b9398d
|
7
|
+
data.tar.gz: f3599dd5fadfc557494ff03002f14e92e02bf21d9e5c787c18cc7260a7dbffc9f85c4bde0d7202b4c1bf384a0bfb29c2c11ca92e40a21c0d6d6b3a79944ebdea
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ gem install traceroute53
|
|
18
18
|
traceroute53 <domain>
|
19
19
|
```
|
20
20
|
|
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
|
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 specify `--profile=PROFILE` option.
|
22
22
|
|
23
23
|
### An example for healthy domain
|
24
24
|
|
@@ -42,7 +42,7 @@ group_ids[0]sg[1]ip[1]: port:nil ["sg-f8f8f8f8"]
|
|
42
42
|
group_ids[0]sg[1]ip[2]: port:22 ["sg-33886655"]
|
43
43
|
```
|
44
44
|
|
45
|
-
### An example for
|
45
|
+
### An example for mismatched security groups
|
46
46
|
|
47
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
48
|
|
data/exe/traceroute53
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# Trace route53 and Load Balancers related to the given domain
|
3
|
-
require 'aws-sdk'
|
3
|
+
require 'aws-sdk-route53'
|
4
|
+
require 'aws-sdk-elasticloadbalancingv2'
|
5
|
+
require 'aws-sdk-ec2'
|
4
6
|
require 'optparse'
|
5
7
|
|
6
8
|
def list_hosted_zones(client)
|
@@ -154,19 +156,25 @@ def main
|
|
154
156
|
# p hosted_zone
|
155
157
|
puts "hosted zone: #{hosted_zone.name}"
|
156
158
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
159
|
+
record_sets = list_resource_record_sets(client, hosted_zone)
|
160
|
+
while true
|
161
|
+
records = record_sets.select{|record| record.name == domain_dot}
|
162
|
+
if records.empty?
|
163
|
+
STDERR.puts "resource record set not found in #{hosted_zone} for #{domain}"
|
164
|
+
exit 1
|
165
|
+
end
|
166
|
+
if records.size != 1
|
167
|
+
STDERR.puts records.inspect
|
168
|
+
STDERR.puts "more than one resource record set in #{hosted_zone} for #{domain}"
|
169
|
+
exit 1
|
170
|
+
end
|
171
|
+
dns_name = records[0].alias_target.dns_name
|
172
|
+
puts "dns name: #{dns_name}"
|
173
|
+
if /([a-z0-9\-]+)\.elb\.amazonaws.com\.\z/ =~ dns_name
|
174
|
+
break
|
175
|
+
end
|
176
|
+
domain_dot = dns_name
|
167
177
|
end
|
168
|
-
dns_name = records[0].alias_target.dns_name
|
169
|
-
puts "dns name: #{dns_name}"
|
170
178
|
dns_name.sub!(/\Adualstack\./, '')
|
171
179
|
dns_name.chomp!('.')
|
172
180
|
|
data/lib/traceroute53/version.rb
CHANGED
data/traceroute53.gemspec
CHANGED
@@ -36,7 +36,9 @@ 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
|
39
|
+
spec.add_dependency 'aws-sdk-route53', "~> 3"
|
40
|
+
spec.add_dependency 'aws-sdk-elasticloadbalancingv2', "~> 3"
|
41
|
+
spec.add_dependency 'aws-sdk-ec2', "~> 3"
|
40
42
|
spec.add_development_dependency "bundler", "~> 1.17"
|
41
43
|
spec.add_development_dependency "rake", "~> 10.0"
|
42
44
|
spec.add_development_dependency "rspec", "~> 3.0"
|
metadata
CHANGED
@@ -1,17 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traceroute53
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
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-
|
11
|
+
date: 2019-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: aws-sdk
|
14
|
+
name: aws-sdk-route53
|
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'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: aws-sdk-elasticloadbalancingv2
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: aws-sdk-ec2
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
16
44
|
requirements:
|
17
45
|
- - "~>"
|