def add_route_to_rt(route_table, cidr, target_type, target_id):
    kwargs = {target_type: target_id}
    route = get_route_by_cidr(route_table, cidr)
    if (route is None):
        route_table.create_route(DestinationCidrBlock=cidr, **kwargs)
    elif (getattr(route, dumb_camel_to_snake(target_type)) != target_id):
        route.replace(**kwargs)
def add_route_to_rt(route_table, cidr, target_type, target_id):
    kwargs = {target_type: target_id}
    route = get_route_by_cidr(route_table, cidr)
    if (route is None):
        route_table.create_route(DestinationCidrBlock=cidr, **kwargs)
    elif (getattr(route, dumb_camel_to_snake(target_type)) != target_id):
        route.replace(**kwargs)