Skip to content

Commit 59fcd74

Browse files
mandar242patchback[bot]
authored andcommitted
route53: add support for type SSHFP (#2430)
SUMMARY Fixes #2413 Adds support for record type 'SSHFP' ISSUE TYPE Feature Pull Request COMPONENT NAME route53 ADDITIONAL INFORMATION Reviewed-by: GomathiselviS <[email protected]> Reviewed-by: Bikouo Aubin (cherry picked from commit c185dc3)
1 parent 52f883d commit 59fcd74

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
minor_changes:
3+
- route53 - Add support for type ``SSHFP`` records (https://github.com/ansible-collections/amazon.aws/pull/2430).

plugins/modules/route53.py

+35-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
type:
4545
description:
4646
- The type of DNS record to create.
47+
- Support for V(SSHFP) was added in release 9.2.0. See AWS Doc for more information
48+
U(https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html).
4749
required: true
48-
choices: [ 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'CAA', 'NS', 'SOA' ]
50+
choices: [ 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'CAA', 'NS', 'SOA', 'SSHFP' ]
4951
type: str
5052
alias:
5153
description:
@@ -273,6 +275,7 @@
273275
ttl: 7200
274276
value: 1.1.1.1,2.2.2.2,3.3.3.3
275277
wait: true
278+
276279
- name: Update new.foo.com as an A record with a list of 3 IPs and wait until the changes have been replicated
277280
amazon.aws.route53:
278281
state: present
@@ -285,13 +288,15 @@
285288
- 2.2.2.2
286289
- 3.3.3.3
287290
wait: true
291+
288292
- name: Retrieve the details for new.foo.com
289293
amazon.aws.route53:
290294
state: get
291295
zone: foo.com
292296
record: new.foo.com
293297
type: A
294298
register: rec
299+
295300
- name: Delete new.foo.com A record using the results from the get command
296301
amazon.aws.route53:
297302
state: absent
@@ -300,6 +305,7 @@
300305
ttl: "{{ rec.set.ttl }}"
301306
type: "{{ rec.set.type }}"
302307
value: "{{ rec.set.value }}"
308+
303309
# Add an AAAA record. Note that because there are colons in the value
304310
# that the IPv6 address must be quoted. Also shows using the old form command=create.
305311
- name: Add an AAAA record
@@ -310,6 +316,7 @@
310316
type: AAAA
311317
ttl: 7200
312318
value: "::1"
319+
313320
# For more information on SRV records see:
314321
# https://en.wikipedia.org/wiki/SRV_record
315322
- name: Add a SRV record with multiple fields for a service on port 22222
@@ -319,6 +326,7 @@
319326
record: "_example-service._tcp.foo.com"
320327
type: SRV
321328
value: "0 0 22222 host1.foo.com,0 0 22222 host2.foo.com"
329+
322330
# Note that TXT and SPF records must be surrounded
323331
# by quotes when sent to Route 53:
324332
- name: Add a TXT record.
@@ -329,6 +337,7 @@
329337
type: TXT
330338
ttl: 7200
331339
value: '"bar"'
340+
332341
- name: Add an alias record that points to an Amazon ELB
333342
amazon.aws.route53:
334343
state: present
@@ -338,13 +347,15 @@
338347
value: "{{ elb_dns_name }}"
339348
alias: true
340349
alias_hosted_zone_id: "{{ elb_zone_id }}"
350+
341351
- name: Retrieve the details for elb.foo.com
342352
amazon.aws.route53:
343353
state: get
344354
zone: foo.com
345355
record: elb.foo.com
346356
type: A
347357
register: rec
358+
348359
- name: Delete an alias record using the results from the get command
349360
amazon.aws.route53:
350361
state: absent
@@ -355,6 +366,7 @@
355366
value: "{{ rec.set.value }}"
356367
alias: true
357368
alias_hosted_zone_id: "{{ rec.set.alias_hosted_zone_id }}"
369+
358370
- name: Add an alias record that points to an Amazon ELB and evaluates it health
359371
amazon.aws.route53:
360372
state: present
@@ -365,6 +377,7 @@
365377
alias: true
366378
alias_hosted_zone_id: "{{ elb_zone_id }}"
367379
alias_evaluate_target_health: true
380+
368381
- name: Add an AAAA record with Hosted Zone ID
369382
amazon.aws.route53:
370383
state: present
@@ -374,6 +387,7 @@
374387
type: AAAA
375388
ttl: 7200
376389
value: "::1"
390+
377391
- name: Use a routing policy to distribute traffic
378392
amazon.aws.route53:
379393
state: present
@@ -386,6 +400,7 @@
386400
identifier: "host1@www"
387401
weight: 100
388402
health_check: "d994b780-3150-49fd-9205-356abdd42e75"
403+
389404
- name: Add a CAA record (RFC 6844)
390405
amazon.aws.route53:
391406
state: present
@@ -396,6 +411,7 @@
396411
- 0 issue "ca.example.net"
397412
- 0 issuewild ";"
398413
- 0 iodef "mailto:[email protected]"
414+
399415
- name: Create a record with geo_location - country_code
400416
amazon.aws.route53:
401417
state: present
@@ -407,6 +423,7 @@
407423
ttl: 30
408424
geo_location:
409425
country_code: US
426+
410427
- name: Create a record with geo_location - subdivision code
411428
amazon.aws.route53:
412429
state: present
@@ -419,6 +436,22 @@
419436
geo_location:
420437
country_code: US
421438
subdivision_code: TX
439+
440+
- name: Add new.foo.com as an SSHFP record
441+
amazon.aws.route53:
442+
state: present
443+
zone: test-zone.com
444+
record: new.foo.com
445+
type: SSHFP
446+
ttl: 7200
447+
value: 1 1 11F1A11D1111112B111C1B11B1C11C11C1234567
448+
449+
- name: Delete new.foo.com as an SSHFP record
450+
amazon.aws.route53:
451+
state: absent
452+
zone: test-zone.com
453+
record: new.foo.com
454+
type: SSHFP
422455
"""
423456

424457
from operator import itemgetter
@@ -558,7 +591,7 @@ def main():
558591
type=dict(
559592
type="str",
560593
required=True,
561-
choices=["A", "AAAA", "CAA", "CNAME", "MX", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"],
594+
choices=["A", "AAAA", "CAA", "CNAME", "MX", "NS", "PTR", "SOA", "SPF", "SSHFP", "SRV", "TXT"],
562595
),
563596
alias=dict(type="bool"),
564597
alias_hosted_zone_id=dict(type="str"),

0 commit comments

Comments
 (0)