'Changes an attribute of a network interface.
:type interface_id: string
:param interface_id: The interface id. Looks like \'eni-xxxxxxxx\'
:type attr: string
:param attr: The attribute you wish to change.
Learn more at http://docs.aws.amazon.com/AWSEC2/latest/API            Reference/ApiReference-query-ModifyNetworkInterfaceAttribute.html
* description - Textual description of interface
* groupSet - List of security group ids or group objects
* sourceDestCheck - Boolean
* deleteOnTermination - Boolean. Must also specify attachment_id
:type value: string
:param value: The new value for the attribute
:rtype: bool
:return: Whether the operation succeeded or not
:type attachment_id: string
:param attachment_id: If you\'re modifying DeleteOnTermination you must
specify the attachment_id.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.'

def modify_network_interface_attribute(self, interface_id, attr, value, attachment_id=None, dry_run=False):

    bool_reqs = ('deleteontermination', 'sourcedestcheck')
    if (attr.lower() in bool_reqs):
        if isinstance(value, bool):
            if value:
                value = 'true'
            else:
                value = 'false'
        elif (value not in ['true', 'false']):
            raise ValueError(('%s    must    be    a    boolean,    "true",    or    "false"!' % attr))
    params = {'NetworkInterfaceId': interface_id}
    if (attr.lower() == 'groupset'):
        for (idx, sg) in enumerate(value):
            if isinstance(sg, SecurityGroup):
                sg = sg.id
            params[('SecurityGroupId.%s' % (idx + 1))] = sg
    elif (attr.lower() == 'description'):
        params['Description.Value'] = value
    elif (attr.lower() == 'sourcedestcheck'):
        params['SourceDestCheck.Value'] = value
    elif (attr.lower() == 'deleteontermination'):
        params['Attachment.DeleteOnTermination'] = value
        if (not attachment_id):
            raise ValueError('You    must    also    specify    an    attachment_id')
        params['Attachment.AttachmentId'] = attachment_id
    else:
        raise ValueError(('Unknown    attribute    "%s"' % (attr,)))
    if dry_run:
        params['DryRun'] = 'true'
    return self.get_status('ModifyNetworkInterfaceAttribute', params, verb='POST')
