'A generator which yields resource instances after doing the
appropriate service operation calls and handling any pagination
on your behalf.
Page size, item limit, and filter parameters are applied
if they have previously been set.
>>> bucket = s3.Bucket(\'boto3\')
>>> for obj in bucket.objects.all():
...     print(obj.key)
\'key1\'
\'key2\''

def __iter__(self):

    limit = self._params.get('limit', None)
    count = 0
    for page in self.pages():
        for item in page:
            (yield item)
            count += 1
            if ((limit is not None) and (count >= limit)):
                return
