Skip to content

iter_describe_stacks

iter_describe_stacks(
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    stack_name: Optional[StackName] = None,
    next_token: Optional[NextToken] = None,
) -> Iterator[Stack]
Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
def iter_describe_stacks(
    self,
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    stack_name: Optional["capo_cloudformation.types.stack_name.StackName"] = None,
    next_token: Optional["capo_cloudformation.types.next_token.NextToken"] = None,
) -> "Iterator[capo_cloudformation.types.stack.Stack]":
    _token = next_token
    while True:
        _response = self.describe_stacks(
            config_overrides=config_overrides,
            stack_name=stack_name,
            next_token=_token,
        )
        _page = _resolve_path(_response, ("stacks",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break