Okay I found the answer to this after clearly reading the documentation. Each 100 records will have a trailing NextRecordType and NextRecordName field if the maxitems returned will be more than 100. We need to use these to get the next 100 items and so on.
This code is working for me, let me know if my approach is wrong.
NextRecordName = 'a'
NextRecordType = 'CNAME'
while(NextRecordName is not None and NextRecordType is not None):
response_per_zone = client.list_resource_record_sets(HostedZoneId=Id,StartRecordName=NextRecordName, StartRecordType=NextRecordType ,MaxItems='400')
try:
NextRecordName = response_per_zone['NextRecordName']
NextRecordType = response_per_zone['NextRecordType']
except Exception as e:
NextRecordName = None
NextRecordType = None
print NextRecordType
print NextRecordName
#Since I need to find CNAME records, this is a function to check whether the record is CNAME, checking it is done using response_record = client.list_resource_record_sets(HostedZoneId=hostedzone, StartRecordName=cname_record, MaxItems='1')
private_zone = resp['Config']['PrivateZone']
if private_zone == False:
find_record(response_per_zone, Id, record_stack)