From 351d33a813e54f1d48d8fc6637fcf9ae8689d65c Mon Sep 17 00:00:00 2001 From: Jason Crowe Date: Wed, 13 Sep 2017 18:44:56 -0500 Subject: [PATCH] Process all resource record sets Use paginator to read all the records, not just the first 100 Fixes #3 --- lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lambda_function.py b/lambda_function.py index 41f9afb..27392be 100644 --- a/lambda_function.py +++ b/lambda_function.py @@ -189,7 +189,7 @@ def lambda_handler(event, context): vpc_zone = dns.zone.Zone(origin=domain_name) print 'Getting VPC SOA serial from Route 53' # Get the SOA from Route 53 by API to avoid getting stale records try: - vpc_recordset = route53.list_resource_record_sets(HostedZoneId=route53_zone_id)['ResourceRecordSets'] + vpc_recordset = list(route53.get_paginator('list_resource_record_sets').paginate(HostedZoneId=route53_zone_id).search('ResourceRecordSets')) for record in vpc_recordset: # Change the record name so that it doesn't have the domain name appended recordname = record['Name'].replace(domain_name + '.', '')