Skip to content

CloudFormationClient.list_stacks

rboto-cloudformation==0.4.0 · Service index · Types

Model summary (excerpt): Returns the summary information for stacks whose status matches the specified StackStatusFilter . Summary information for stacks that have been deleted is kept for 90 days after the stack is deleted. If no StackStatusFilter is specified, summary information for all stacks is returned (including existing stacks and stacks that have been deleted).

Install and imports

python -m pip install "rboto[cloudformation]==0.4.0"
from rboto import CloudFormationClient
from collections.abc import Sequence
from rboto_cloudformation.types import (
    ListStacksOutput,
    StackStatus,
)

Signature

async def list_stacks(
    *,
    next_token: str | None = None,
    stack_status_filter: Sequence[StackStatus] | None = None,
) -> ListStacksOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
next_token No The token for the next set of items to return. (You received this token from a previous call.)
stack_status_filter No Stack status to use as a filter. Specify one or more stack status codes to list only stacks with the specified status codes. For a complete list of stack status codes, see the StackStatus parameter of the Stack data type.

Output

ListStacksOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
stack_summaries list[StackSummaryOutput] | None Always present StackSummaryOutput
next_token str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

ListStacksOutput, StackStatus

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

client.paginators.list_stacks(...) accepts the same arguments and returns AsyncIterator[ListStacksOutput]. Direct calls return one page. Pages preserve the Output representation above.

Input cursors: next_token. Page-size argument: not exposed.

No output stream.

Errors

No modeled service errors for this operation.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Example

Complete, type-checked service example. Replace its placeholders and configure credentials before running it.

#!/usr/bin/env python3
import asyncio

from rboto import CloudFormationClient


async def main() -> None:
    async with CloudFormationClient(region="eu-west-1") as client:
        async for page in client.paginators.list_stacks(
            stack_status_filter=["CREATE_COMPLETE", "UPDATE_COMPLETE"],
        ):
            for stack in page.stack_summaries or []:
                print(stack.stack_name, stack.stack_status)


if __name__ == "__main__":
    asyncio.run(main())

Service guide · Pinned model