Class: Acmesmith::ChallengeResponders::Route53
- Inherits:
-
Base
- Object
- Base
- Acmesmith::ChallengeResponders::Route53
show all
- Defined in:
- lib/acmesmith/challenge_responders/route53.rb
Defined Under Namespace
Classes: AmbiguousHostedZones, HostedZoneNotFound
Instance Method Summary
collapse
Methods inherited from Base
#cleanup, #respond
Constructor Details
#initialize(aws_access_key: nil, hosted_zone_map: {}) ⇒ Route53
Returns a new instance of Route53.
20
21
22
23
24
25
26
|
# File 'lib/acmesmith/challenge_responders/route53.rb', line 20
def initialize(aws_access_key: nil, hosted_zone_map: {})
@route53 = Aws::Route53::Client.new({region: 'us-east-1'}.tap do |opt|
opt[:credentials] = Aws::Credentials.new(aws_access_key['access_key_id'], aws_access_key['secret_access_key'], aws_access_key['session_token']) if aws_access_key
end)
@hosted_zone_map = hosted_zone_map
@hosted_zone_cache = {}
end
|
Instance Method Details
#cap_respond_all? ⇒ Boolean
16
17
18
|
# File 'lib/acmesmith/challenge_responders/route53.rb', line 16
def cap_respond_all?
true
end
|
#cleanup_all(*domain_and_challenges) ⇒ Object
39
40
41
42
43
44
45
46
47
|
# File 'lib/acmesmith/challenge_responders/route53.rb', line 39
def cleanup_all(*domain_and_challenges)
challenges_by_hosted_zone = domain_and_challenges.group_by { |(domain, _)| find_hosted_zone(domain) }
zone_and_batches = challenges_by_hosted_zone.map do |zone_id, dcs|
[zone_id, change_batch_for_challenges(dcs, action: 'DELETE', comment: '(cleanup)')]
end
request_changing_rrset(zone_and_batches, comment: 'to remove challenge responses')
end
|
#respond_all(*domain_and_challenges) ⇒ Object
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/acmesmith/challenge_responders/route53.rb', line 28
def respond_all(*domain_and_challenges)
challenges_by_hosted_zone = domain_and_challenges.group_by { |(domain, _)| find_hosted_zone(domain) }
zone_and_batches = challenges_by_hosted_zone.map do |zone_id, dcs|
[zone_id, change_batch_for_challenges(dcs, action: 'UPSERT')]
end
change_ids = request_changing_rrset(zone_and_batches, comment: 'for challenge response')
wait_for_sync(change_ids)
end
|
#support?(type) ⇒ Boolean
11
12
13
14
|
# File 'lib/acmesmith/challenge_responders/route53.rb', line 11
def support?(type)
type == 'dns-01'
end
|