Set attributes on an ELB.

    CLI example to set attributes on an ELB:

    .. code-block:: bash

        salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}'

def set_health_check(name, health_check, region=None, key=None, keyid=None,
                     profile=None):
    '''
    Set attributes on an ELB.

    CLI example to set attributes on an ELB:

    .. code-block:: bash

        salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}'
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    retries = 30

    hc = HealthCheck(**health_check)
    while True:
        try:
            conn.configure_health_check(name, hc)
            log.info('Configured health check on ELB %s', name)
            return True
        except boto.exception.BotoServerError as error:
            if retries and e.code == 'Throttling':
                log.debug('Throttled by AWS API, will retry in 5 seconds.')
                time.sleep(5)
                retries -= 1
                continue
            log.exception('Failed to configure health check on ELB %s', name)
            return False