roadworker 0.5.5.beta4 → 0.5.5.beta5
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/README.md +3 -2
- data/bin/roadwork +3 -3
- data/lib/roadworker/client.rb +4 -6
- data/lib/roadworker/collection.rb +3 -9
- data/lib/roadworker/dsl.rb +7 -7
- data/lib/roadworker/route53-exporter.rb +5 -4
- data/lib/roadworker/route53-ext.rb +13 -7
- data/lib/roadworker/route53-health-check.rb +17 -19
- data/lib/roadworker/route53-wrapper.rb +88 -44
- data/lib/roadworker/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 292c907fb987acc0bbb3062ff2ebcb35142e7cf9
|
4
|
+
data.tar.gz: 2e45b43a43831f14fa42f6e127e7b6d98251d4ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b76aefef72d4d62356ba3bd6ea52f1eba5545b97bb765d9899e6d7aa81c3f900ff45153bb061672e81584525811683aae2740e0c4a34ff8ceab4e414080a7d19
|
7
|
+
data.tar.gz: 6e82becf01cc502f8d1ff35fbeb0b96ba8b59b1bcff1bcadea45376e8d639c794a839a9be89460c0f1ab3af59d306fb6e2aa44b553e73e5ee06532887dc09210
|
data/README.md
CHANGED
@@ -4,9 +4,9 @@ Roadworker is a tool to manage Route53.
|
|
4
4
|
|
5
5
|
It defines the state of Route53 using DSL, and updates Route53 according to DSL.
|
6
6
|
|
7
|
-
[](http://badge.fury.io/rb/roadworker)
|
8
8
|
[](https://travis-ci.org/winebarrel/roadworker)
|
9
|
-
[](https://coveralls.io/github/winebarrel/roadworker?branch=master)
|
10
10
|
|
11
11
|
**Notice**
|
12
12
|
|
@@ -14,6 +14,7 @@ It defines the state of Route53 using DSL, and updates Route53 according to DSL.
|
|
14
14
|
* `>= 0.4.3` compare resource records ignoring the order.
|
15
15
|
* `>= 0.5.5`
|
16
16
|
* **Disable Divided HostedZone**
|
17
|
+
* **Use aws-sdk v2** [PR#20](https://github.com/winebarrel/roadworker/pull/20)
|
17
18
|
|
18
19
|
## Installation
|
19
20
|
|
data/bin/roadwork
CHANGED
@@ -71,13 +71,13 @@ ARGV.options do |opt|
|
|
71
71
|
credentials_opts = {}
|
72
72
|
credentials_opts[:profile_name] = profile_name if profile_name
|
73
73
|
credentials_opts[:path] = credentials_path if credentials_path
|
74
|
-
provider =
|
74
|
+
provider = Aws::SharedCredentials.new(credentials_opts)
|
75
75
|
aws_opts[:credential_provider] = provider
|
76
76
|
elsif (access_key and !secret_key) or (!access_key and secret_key) or mode.nil?
|
77
77
|
puts opt.help
|
78
78
|
exit 1
|
79
79
|
end
|
80
|
-
|
80
|
+
Aws.config.update(aws_opts)
|
81
81
|
rescue => e
|
82
82
|
$stderr.puts e
|
83
83
|
exit 1
|
@@ -85,7 +85,7 @@ ARGV.options do |opt|
|
|
85
85
|
end
|
86
86
|
|
87
87
|
if options[:debug]
|
88
|
-
|
88
|
+
Aws.config.update(
|
89
89
|
:http_wire_trace => true,
|
90
90
|
:logger => options[:logger]
|
91
91
|
)
|
data/lib/roadworker/client.rb
CHANGED
@@ -7,7 +7,7 @@ module Roadworker
|
|
7
7
|
@options = OpenStruct.new(options)
|
8
8
|
@options.logger ||= Logger.new($stdout)
|
9
9
|
String.colorize = @options.color
|
10
|
-
@options.route53 =
|
10
|
+
@options.route53 = Aws::Route53::Client.new
|
11
11
|
@health_checks = HealthCheck.health_checks(@options.route53, :extended => true)
|
12
12
|
@options.health_checks = @health_checks
|
13
13
|
@route53 = Route53Wrapper.new(@options)
|
@@ -20,10 +20,8 @@ module Roadworker
|
|
20
20
|
if dsl.hosted_zones.empty? and not @options.force
|
21
21
|
log(:warn, "Nothing is defined (pass `--force` if you want to remove)", :yellow)
|
22
22
|
else
|
23
|
-
|
24
|
-
|
25
|
-
updated = @options.updated
|
26
|
-
}
|
23
|
+
walk_hosted_zones(dsl)
|
24
|
+
updated = @options.updated
|
27
25
|
end
|
28
26
|
|
29
27
|
if updated and not @options.no_health_check_gc
|
@@ -34,7 +32,7 @@ module Roadworker
|
|
34
32
|
end
|
35
33
|
|
36
34
|
def export
|
37
|
-
exported =
|
35
|
+
exported = @route53.export
|
38
36
|
|
39
37
|
if block_given?
|
40
38
|
yield(exported, DSL.method(:convert))
|
@@ -2,15 +2,9 @@ module Roadworker
|
|
2
2
|
class Collection
|
3
3
|
|
4
4
|
class << self
|
5
|
-
def batch(
|
6
|
-
|
7
|
-
|
8
|
-
batch.each do |item|
|
9
|
-
yield(item)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
else
|
13
|
-
collection.each do |item|
|
5
|
+
def batch(pageable_response, collection_name)
|
6
|
+
pageable_response.each do |response|
|
7
|
+
response.public_send(collection_name).each do |item|
|
14
8
|
yield(item)
|
15
9
|
end
|
16
10
|
end
|
data/lib/roadworker/dsl.rb
CHANGED
@@ -70,7 +70,7 @@ module Roadworker
|
|
70
70
|
raise "Invalid VPC ID: #{vpc_id}"
|
71
71
|
end
|
72
72
|
|
73
|
-
vpc_h =
|
73
|
+
vpc_h = Aws::Route53::Types::VPC.new(:vpc_region => vpc_region.to_s, :vpc_id => vpc_id.to_s)
|
74
74
|
|
75
75
|
if @result.vpcs.include?(vpc_h)
|
76
76
|
raise "VPC is already defined: #{vpc_h.inspect}"
|
@@ -120,7 +120,7 @@ module Roadworker
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def dns_name(value, options = {})
|
123
|
-
options =
|
123
|
+
options = Aws::Route53.normalize_dns_name_options(options)
|
124
124
|
@result.dns_name = [value, options]
|
125
125
|
end
|
126
126
|
|
@@ -159,12 +159,12 @@ module Roadworker
|
|
159
159
|
end
|
160
160
|
end
|
161
161
|
|
162
|
-
if config
|
163
|
-
config
|
162
|
+
if config.search_string
|
163
|
+
config.type += '_STR_MATCH'
|
164
164
|
end
|
165
165
|
|
166
|
-
config
|
167
|
-
config
|
166
|
+
config.request_interval ||= 30
|
167
|
+
config.failure_threshold ||= 3
|
168
168
|
|
169
169
|
@result.health_check = config
|
170
170
|
end
|
@@ -174,7 +174,7 @@ module Roadworker
|
|
174
174
|
raise "Duplicate ResourceRecords: #{values.join(', ')}"
|
175
175
|
end
|
176
176
|
|
177
|
-
@result.resource_records = [values].flatten.map {|i|
|
177
|
+
@result.resource_records = [values].flatten.map {|i| Aws::Route53::Types::ResourceRecord.new(:value => i) }
|
178
178
|
end
|
179
179
|
|
180
180
|
end # ResourceRecordSet
|
@@ -26,15 +26,16 @@ module Roadworker
|
|
26
26
|
private
|
27
27
|
|
28
28
|
def export_hosted_zones(hosted_zones)
|
29
|
-
Collection.batch(@options.route53.hosted_zones) do |zone|
|
30
|
-
zone_h = item_to_hash(zone, :name, :vpcs)
|
29
|
+
Collection.batch(@options.route53.list_hosted_zones, :hosted_zones) do |zone|
|
31
30
|
next unless matched_zone?(zone.name)
|
31
|
+
resp = @options.route53.get_hosted_zone(id: zone.id)
|
32
|
+
zone_h = { name: zone.name, vpcs: resp.vp_cs }
|
32
33
|
hosted_zones << zone_h
|
33
34
|
|
34
35
|
rrsets = []
|
35
36
|
zone_h[:rrsets] = rrsets
|
36
37
|
|
37
|
-
Collection.batch(zone.
|
38
|
+
Collection.batch(@options.route53.list_resource_record_sets(hosted_zone_id: zone.id), :resource_record_sets) do |record|
|
38
39
|
if record.name == zone.name and %w(SOA NS).include?(record.type) and not @options.with_soa_ns
|
39
40
|
next
|
40
41
|
end
|
@@ -78,7 +79,7 @@ module Roadworker
|
|
78
79
|
h = {}
|
79
80
|
|
80
81
|
attrs.each do |attribute|
|
81
|
-
value = item.
|
82
|
+
value = item.public_send(attribute)
|
82
83
|
h[attribute] = value if value
|
83
84
|
end
|
84
85
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'aws-sdk
|
1
|
+
require 'aws-sdk'
|
2
2
|
|
3
|
-
module
|
4
|
-
|
3
|
+
module Aws
|
4
|
+
module Route53
|
5
5
|
|
6
6
|
# http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
|
7
7
|
S3_WEBSITE_ENDPOINTS = {
|
@@ -59,10 +59,16 @@ module AWS
|
|
59
59
|
private
|
60
60
|
|
61
61
|
def elb_dns_name_to_alias_target(name, region)
|
62
|
-
elb =
|
63
|
-
|
64
|
-
load_balancer =
|
65
|
-
|
62
|
+
elb = Aws::ElasticLoadBalancing::Client.new(:region => region)
|
63
|
+
|
64
|
+
load_balancer = nil
|
65
|
+
elb.describe_load_balancers.each do |page|
|
66
|
+
page.load_balancer_descriptions.each do |lb|
|
67
|
+
if lb.dns_name == name
|
68
|
+
load_balancer = lb
|
69
|
+
end
|
70
|
+
end
|
71
|
+
break if load_balancer
|
66
72
|
end
|
67
73
|
|
68
74
|
unless load_balancer
|
@@ -49,7 +49,7 @@ module Roadworker
|
|
49
49
|
path = nil
|
50
50
|
end
|
51
51
|
|
52
|
-
config =
|
52
|
+
config = Aws::Route53::Types::HealthCheckConfig.new
|
53
53
|
|
54
54
|
{
|
55
55
|
:port => url.port,
|
@@ -60,9 +60,9 @@ module Roadworker
|
|
60
60
|
}
|
61
61
|
|
62
62
|
if url.host =~ /\A\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\Z/
|
63
|
-
config
|
63
|
+
config.ip_address = url.host
|
64
64
|
else
|
65
|
-
config
|
65
|
+
config.fully_qualified_domain_name = url.host
|
66
66
|
end
|
67
67
|
|
68
68
|
return config
|
@@ -81,7 +81,7 @@ module Roadworker
|
|
81
81
|
|
82
82
|
while is_truncated
|
83
83
|
opts = next_marker ? {:marker => next_marker} : {}
|
84
|
-
response = @route53.
|
84
|
+
response = @route53.list_health_checks(opts)
|
85
85
|
|
86
86
|
response[:health_checks].each do |check|
|
87
87
|
check_list[check[:id]] = check[:health_check_config]
|
@@ -98,7 +98,7 @@ module Roadworker
|
|
98
98
|
health_check_id, config = self.find {|hcid, elems| elems == attrs }
|
99
99
|
|
100
100
|
unless health_check_id
|
101
|
-
response = @route53.
|
101
|
+
response = @route53.create_health_check({
|
102
102
|
:caller_reference => UUID.new.generate,
|
103
103
|
:health_check_config => attrs,
|
104
104
|
})
|
@@ -116,24 +116,22 @@ module Roadworker
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def gc(options = {})
|
119
|
-
|
120
|
-
|
121
|
-
return if check_list.empty?
|
119
|
+
check_list = health_checks
|
120
|
+
return if check_list.empty?
|
122
121
|
|
123
|
-
|
124
|
-
|
125
|
-
|
122
|
+
if (logger = options[:logger])
|
123
|
+
logger.info('Clean HealthChecks (pass `--no-health-check-gc` if you do not want to clean)')
|
124
|
+
end
|
126
125
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
end
|
126
|
+
Collection.batch(@route53.list_hosted_zones, :hosted_zones) do |zone|
|
127
|
+
Collection.batch(@route53.list_resource_record_sets(hosted_zone_id: zone.id), :resource_record_sets) do |record|
|
128
|
+
check_list.delete(record.health_check_id)
|
131
129
|
end
|
130
|
+
end
|
132
131
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
}
|
132
|
+
check_list.each do |health_check_id, config|
|
133
|
+
@route53.delete_health_check(:health_check_id => health_check_id)
|
134
|
+
end
|
137
135
|
end
|
138
136
|
|
139
137
|
end # HealthCheck
|
@@ -24,20 +24,21 @@ module Roadworker
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def hosted_zones
|
27
|
-
HostedZoneCollectionWrapper.new(@options.route53.
|
27
|
+
HostedZoneCollectionWrapper.new(@options.route53.list_hosted_zones, @options)
|
28
28
|
end
|
29
29
|
|
30
30
|
class HostedZoneCollectionWrapper
|
31
31
|
include Roadworker::Log
|
32
32
|
|
33
|
-
def initialize(
|
34
|
-
@
|
33
|
+
def initialize(hosted_zones_response, options)
|
34
|
+
@hosted_zones_response = hosted_zones_response
|
35
35
|
@options = options
|
36
36
|
end
|
37
37
|
|
38
38
|
def each
|
39
|
-
Collection.batch(@hosted_zones) do |zone|
|
40
|
-
|
39
|
+
Collection.batch(@hosted_zones_response, :hosted_zones) do |zone|
|
40
|
+
resp = @options.route53.get_hosted_zone(id: zone.id)
|
41
|
+
yield(HostedZoneWrapper.new(resp.hosted_zone, resp.vp_cs, @options))
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
@@ -57,7 +58,14 @@ module Roadworker
|
|
57
58
|
opts.delete(:vpc)
|
58
59
|
zone = OpenStruct.new({:name => name, :rrsets => [], :vpcs => vpcs}.merge(opts))
|
59
60
|
else
|
60
|
-
|
61
|
+
params = {
|
62
|
+
name: name,
|
63
|
+
caller_reference: "CreateHostedZone by roadworker #{Roadworker::VERSION}, #{name}, #{Time.now.httpdate}",
|
64
|
+
}
|
65
|
+
if vpc
|
66
|
+
params[:vpc] = vpc
|
67
|
+
end
|
68
|
+
zone = @options.route53.create_hosted_zone(params).hosted_zone
|
61
69
|
@options.hosted_zone_name = name
|
62
70
|
@options.updated = true
|
63
71
|
end
|
@@ -78,7 +86,7 @@ module Roadworker
|
|
78
86
|
attr_reader :vpcs
|
79
87
|
|
80
88
|
def resource_record_sets
|
81
|
-
ResourceRecordSetCollectionWrapper.new(@hosted_zone
|
89
|
+
ResourceRecordSetCollectionWrapper.new(@hosted_zone, @options)
|
82
90
|
end
|
83
91
|
alias rrsets resource_record_sets
|
84
92
|
|
@@ -91,24 +99,7 @@ module Roadworker
|
|
91
99
|
end
|
92
100
|
|
93
101
|
unless @options.dry_run
|
94
|
-
@hosted_zone.
|
95
|
-
@options.updated = true
|
96
|
-
end
|
97
|
-
else
|
98
|
-
log(:info, 'Undefined HostedZone (pass `--force` if you want to remove)', :yellow, @hosted_zone.name)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
def delete
|
103
|
-
if @options.force
|
104
|
-
log(:info, 'Delete HostedZone', :red, @hosted_zone.name)
|
105
|
-
|
106
|
-
self.rrsets.each do |record|
|
107
|
-
record.delete
|
108
|
-
end
|
109
|
-
|
110
|
-
unless @options.dry_run
|
111
|
-
@hosted_zone.delete
|
102
|
+
@options.route53.delete_hosted_zone(id: @hosted_zone.id)
|
112
103
|
@options.updated = true
|
113
104
|
end
|
114
105
|
else
|
@@ -118,12 +109,22 @@ module Roadworker
|
|
118
109
|
|
119
110
|
def associate_vpc(vpc)
|
120
111
|
log(:info, "Associate #{vpc.inspect}", :green, @hosted_zone.name)
|
121
|
-
|
112
|
+
unless @options.dry_run
|
113
|
+
@options.route53.associate_vpc_with_hosted_zone(
|
114
|
+
hosted_zone_id: @hosted_zone.id,
|
115
|
+
vpc: vpc,
|
116
|
+
)
|
117
|
+
end
|
122
118
|
end
|
123
119
|
|
124
120
|
def disassociate_vpc(vpc)
|
125
121
|
log(:info, "Disassociate #{vpc.inspect}", :red, @hosted_zone.name)
|
126
|
-
|
122
|
+
unless @options.dry_run
|
123
|
+
@options.route53.disassociate_vpc_from_hosted_zone(
|
124
|
+
hosted_zone_id: @hosted_zone.id,
|
125
|
+
vpc: vpc,
|
126
|
+
)
|
127
|
+
end
|
127
128
|
end
|
128
129
|
|
129
130
|
private
|
@@ -136,15 +137,16 @@ module Roadworker
|
|
136
137
|
class ResourceRecordSetCollectionWrapper
|
137
138
|
include Roadworker::Log
|
138
139
|
|
139
|
-
def initialize(
|
140
|
-
@resource_record_sets = resource_record_sets
|
140
|
+
def initialize(hosted_zone, options)
|
141
141
|
@hosted_zone = hosted_zone
|
142
142
|
@options = options
|
143
143
|
end
|
144
144
|
|
145
145
|
def each
|
146
|
-
|
147
|
-
|
146
|
+
if @hosted_zone.id
|
147
|
+
Collection.batch(@options.route53.list_resource_record_sets(hosted_zone_id: @hosted_zone.id), :resource_record_sets) do |record|
|
148
|
+
yield(ResourceRecordSetWrapper.new(record, @hosted_zone, @options))
|
149
|
+
end
|
148
150
|
end
|
149
151
|
end
|
150
152
|
|
@@ -158,7 +160,10 @@ module Roadworker
|
|
158
160
|
if @options.dry_run
|
159
161
|
record = expected_record
|
160
162
|
else
|
161
|
-
|
163
|
+
resource_record_set_params = {
|
164
|
+
name: name,
|
165
|
+
type: type,
|
166
|
+
}
|
162
167
|
|
163
168
|
Route53Wrapper::RRSET_ATTRS.each do |attribute|
|
164
169
|
value = expected_record.send(attribute)
|
@@ -168,20 +173,30 @@ module Roadworker
|
|
168
173
|
when :dns_name
|
169
174
|
attribute = :alias_target
|
170
175
|
dns_name, dns_name_opts = value
|
171
|
-
value =
|
176
|
+
value = Aws::Route53.dns_name_to_alias_target(dns_name, dns_name_opts, @hosted_zone.id, @hosted_zone.name || @options.hosted_zone_name)
|
172
177
|
when :health_check
|
173
178
|
attribute = :health_check_id
|
174
179
|
value = @options.health_checks.find_or_create(value)
|
175
180
|
end
|
176
181
|
|
177
|
-
|
182
|
+
resource_record_set_params[attribute] = value
|
178
183
|
end
|
179
184
|
|
180
|
-
|
185
|
+
@options.route53.change_resource_record_sets(
|
186
|
+
hosted_zone_id: @hosted_zone.id,
|
187
|
+
change_batch: {
|
188
|
+
changes: [
|
189
|
+
{
|
190
|
+
action: 'CREATE',
|
191
|
+
resource_record_set: resource_record_set_params,
|
192
|
+
},
|
193
|
+
],
|
194
|
+
},
|
195
|
+
)
|
181
196
|
@options.updated = true
|
182
197
|
end
|
183
198
|
|
184
|
-
ResourceRecordSetWrapper.new(
|
199
|
+
ResourceRecordSetWrapper.new(expected_record, @hosted_zone, @options)
|
185
200
|
end
|
186
201
|
end # ResourceRecordSetCollectionWrapper
|
187
202
|
|
@@ -196,10 +211,10 @@ module Roadworker
|
|
196
211
|
|
197
212
|
def eql?(expected_record)
|
198
213
|
Route53Wrapper::RRSET_ATTRS_WITH_TYPE.all? do |attribute|
|
199
|
-
expected = expected_record.
|
214
|
+
expected = expected_record.public_send(attribute)
|
200
215
|
expected = expected.sort_by {|i| i.to_s } if expected.kind_of?(Array)
|
201
216
|
expected = nil if expected.kind_of?(Array) && expected.empty?
|
202
|
-
actual = self.
|
217
|
+
actual = self.public_send(attribute)
|
203
218
|
actual = actual.sort_by {|i| i.to_s } if actual.kind_of?(Array)
|
204
219
|
actual = nil if actual.kind_of?(Array) && actual.empty?
|
205
220
|
|
@@ -228,6 +243,7 @@ module Roadworker
|
|
228
243
|
|
229
244
|
log(:info, 'Update ResourceRecordSet', :green, &log_id_proc)
|
230
245
|
|
246
|
+
resource_record_set_prev = @resource_record_set.dup
|
231
247
|
Route53Wrapper::RRSET_ATTRS_WITH_TYPE.each do |attribute|
|
232
248
|
expected = expected_record.send(attribute)
|
233
249
|
expected = expected.sort_by {|i| i.to_s } if expected.kind_of?(Array)
|
@@ -238,17 +254,35 @@ module Roadworker
|
|
238
254
|
|
239
255
|
if (expected and !actual) or (!expected and actual)
|
240
256
|
log(:info, " set #{attribute}=#{expected.inspect}" , :green)
|
241
|
-
|
257
|
+
unless @options.dry_run
|
258
|
+
self.send(:"#{attribute}=", expected)
|
259
|
+
end
|
242
260
|
elsif expected and actual
|
243
261
|
if expected != actual
|
244
262
|
log(:info, " set #{attribute}=#{expected.inspect}" , :green)
|
245
|
-
|
263
|
+
unless @options.dry_run
|
264
|
+
self.send(:"#{attribute}=", expected)
|
265
|
+
end
|
246
266
|
end
|
247
267
|
end
|
248
268
|
end
|
249
269
|
|
250
270
|
unless @options.dry_run
|
251
|
-
@
|
271
|
+
@options.route53.change_resource_record_sets(
|
272
|
+
hosted_zone_id: @hosted_zone.id,
|
273
|
+
change_batch: {
|
274
|
+
changes: [
|
275
|
+
{
|
276
|
+
action: 'DELETE',
|
277
|
+
resource_record_set: resource_record_set_prev,
|
278
|
+
},
|
279
|
+
{
|
280
|
+
action: 'CREATE',
|
281
|
+
resource_record_set: @resource_record_set,
|
282
|
+
},
|
283
|
+
],
|
284
|
+
},
|
285
|
+
)
|
252
286
|
@options.updated = true
|
253
287
|
end
|
254
288
|
end
|
@@ -267,7 +301,17 @@ module Roadworker
|
|
267
301
|
end
|
268
302
|
|
269
303
|
unless @options.dry_run
|
270
|
-
@
|
304
|
+
@options.route53.change_resource_record_sets(
|
305
|
+
hosted_zone_id: @hosted_zone.id,
|
306
|
+
change_batch: {
|
307
|
+
changes: [
|
308
|
+
{
|
309
|
+
action: 'DELETE',
|
310
|
+
resource_record_set: @resource_record_set,
|
311
|
+
},
|
312
|
+
],
|
313
|
+
},
|
314
|
+
)
|
271
315
|
@options.updated = true
|
272
316
|
end
|
273
317
|
end
|
@@ -284,7 +328,7 @@ module Roadworker
|
|
284
328
|
if dns_name
|
285
329
|
[
|
286
330
|
dns_name,
|
287
|
-
|
331
|
+
Aws::Route53.normalize_dns_name_options(alias_target),
|
288
332
|
]
|
289
333
|
else
|
290
334
|
nil
|
@@ -294,7 +338,7 @@ module Roadworker
|
|
294
338
|
def dns_name=(value)
|
295
339
|
if value
|
296
340
|
dns_name, dns_name_opts = value
|
297
|
-
@resource_record_set.alias_target =
|
341
|
+
@resource_record_set.alias_target = Aws::Route53.dns_name_to_alias_target(dns_name, dns_name_opts, @hosted_zone.id, @hosted_zone.name || @options.hosted_zone_name)
|
298
342
|
else
|
299
343
|
@resource_record_set.alias_target = nil
|
300
344
|
end
|
data/lib/roadworker/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roadworker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.5.
|
4
|
+
version: 0.5.5.beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07
|
11
|
+
date: 2015-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: aws-sdk
|
14
|
+
name: aws-sdk
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 2.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 2.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: term-ansicolor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
222
|
version: 1.3.1
|
223
223
|
requirements: []
|
224
224
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.0.14
|
225
|
+
rubygems_version: 2.0.14.1
|
226
226
|
signing_key:
|
227
227
|
specification_version: 4
|
228
228
|
summary: Roadworker is a tool to manage Route53.
|