'Iterates over all the resources in a stack.
Iterating includes nested stacks up to `nested_depth` levels below.'

def iter_resources(self, nested_depth=0, filters=None):

    for res in self._find_filtered_resources(filters):
        (yield res)
    resources = self._find_filtered_resources()
    for res in resources:
        if ((not res.has_nested()) or (nested_depth == 0)):
            continue
        nested_stack = res.nested()
        if (nested_stack is None):
            continue
        for nested_res in nested_stack.iter_resources((nested_depth - 1), filters):
            (yield nested_res)
