'Returns states of mount targets of selected EFS with selected state(s) (optional)'

def get_mount_targets_in_state(self, file_system_id, states=None):

    targets = iterate_all('MountTargets', self.connection.describe_mount_targets, FileSystemId=file_system_id)
    if states:
        if (not isinstance(states, list)):
            states = [states]
        targets = filter((lambda target: (target['LifeCycleState'] in states)), targets)
    return list(targets)
