def handler(event, context):
    """
    Historical {{cookiecutter.technology_name}} event collector.
    This collector is responsible for processing Cloudwatch events and polling events.
    """
    records = deserialize_records(event['Records'])

    # Split records into two groups, update and delete.
    # We don't want to query for deleted records.
    update_records, delete_records = group_records_by_type(records)
    capture_delete_records(delete_records)

    # filter out error events
    update_records = [e for e in update_records if not e['detail'].get('errorCode')]

    # group records by account for more efficient processing
    log.debug('Update Records: {records}'.format(records=records))

    capture_update_records(update_records)
def handler ( event , context ) : records = deserialize_records ( event [ 'Records' ] ) update_records , delete_records = group_records_by_type ( records ) capture_delete_records ( delete_records ) update_records = [ e for e in update_records if not e [ 'detail' ] . get ( 'errorCode' ) ] log . debug ( 'Update Records: {records}' . format ( records = records ) ) capture_update_records ( update_records )
Historical {{cookiecutter.technology_name}} event collector.
    This collector is responsible for processing Cloudwatch events and polling events.