From b3176d3f70806c1b17b651c45ca0d9565c301aba Mon Sep 17 00:00:00 2001 From: David Morton Date: Wed, 18 Nov 2015 15:49:51 +1300 Subject: [PATCH] Catered for NS record migrations excluding apex --- route53-migrate-zone/route53-migrate-zone.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/route53-migrate-zone/route53-migrate-zone.py b/route53-migrate-zone/route53-migrate-zone.py index 2634ec7..b731d39 100755 --- a/route53-migrate-zone/route53-migrate-zone.py +++ b/route53-migrate-zone/route53-migrate-zone.py @@ -71,7 +71,7 @@ def diff_record(record_a, record_a_object, record_b, record_b_object): # best would be to retreive the destination_zone_id using destination_zone_name destination_zone_id = config.get('destination_zone_values', 'destination_zone_id') -record_types_to_migrate = ['A', 'CNAME', 'MX', 'TXT'] +record_types_to_migrate = ['A', 'CNAME', 'MX', 'NS', 'TXT'] if source_zone_name != destination_zone_name: logging.info('{app_name!s} will rewrite domain names ending in {source_zone_name!s} to domain names ending in {destination_zone_name!s}'.format @@ -164,6 +164,8 @@ def diff_record(record_a, record_a_object, record_b, record_b_object): .format(record_name=record.name)) exit(70) else: + if record.type == 'NS' and record.name == "%s." % destination_zone_name: + continue resource_record_dict[record.name] = boto.route53.record.Record(name=record.name, type=record.type, ttl=record.ttl,