Delete target group.

    name
        (string) - The Amazon Resource Name (ARN) of the resource.

    returns
        (bool) - True on success, False on failure.

    CLI example:

    .. code-block:: bash

        check-target:
          boto_elb2.delete_targets_group:
            - name: myALB
            - protocol: https
            - port: 443
            - vpc_id: myVPC

def delete_target_group(name, region=None, key=None, keyid=None, profile=None):
    '''
    Delete target group.

    name
        (string) - The Amazon Resource Name (ARN) of the resource.

    returns
        (bool) - True on success, False on failure.

    CLI example:

    .. code-block:: bash

        check-target:
          boto_elb2.delete_targets_group:
            - name: myALB
            - protocol: https
            - port: 443
            - vpc_id: myVPC
    '''
    ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}

    if not __salt__['boto_elbv2.target_group_exists'](name, region, key, keyid, profile):
        ret['result'] = True
        ret['comment'] = 'Target Group {0} does not exists'.format(name)
        return ret

    if __opts__['test']:
        ret['comment'] = 'Target Group {0} will be deleted'.format(name)
        return ret

    state = __salt__['boto_elbv2.delete_target_group'](name,
                                                       region=region,
                                                       key=key,
                                                       keyid=keyid,
                                                       profile=profile)

    if state:
        ret['result'] = True
        ret['changes']['target_group'] = name
        ret['comment'] = 'Target Group {0} deleted'.format(name)
    else:
        ret['result'] = False
        ret['comment'] = 'Target Group {0} deletion failed'.format(name)
    return ret