:doc:`ServiceResource <index>` / Collection / stacks

******
stacks
******



.. py:attribute:: CloudFormation.ServiceResource.stacks

  A collection of Stack resources.A Stack Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.

  .. py:method:: all()

    Creates an iterable of all Stack resources in the collection.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks>`_    


    **Request Syntax**
    ::

      stack_iterator = cloudformation.stacks.all()
      
      
    
    :rtype: list(:py:class:`cloudformation.Stack`)
    :returns: A list of Stack resources
    

  .. py:method:: filter(**kwargs)

    Creates an iterable of all Stack resources in the collection filtered by kwargs passed to method. A Stack collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks>`_    


    **Request Syntax**
    ::

      stack_iterator = cloudformation.stacks.filter(
          StackName='string',
          NextToken='string'
      )
      
    :type StackName: string
    :param StackName: 

      .. note::

        

        If you don't pass a parameter to ``StackName``, the API returns a response that describes all resources in the account, which can impact performance. This requires ``ListStacks`` and ``DescribeStacks`` permissions.

         

        Consider using the  ListStacks API if you're not passing a parameter to ``StackName``.

         

        The IAM policy below can be added to IAM policies when you want to limit resource-level permissions and avoid returning a response when no parameter is sent in the request:

         

        { "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": "cloudformation:DescribeStacks", "NotResource": "arn:aws:cloudformation:*:*:stack/*/*" }] }

        

       

      The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:

       

      
      * Running stacks: You can specify either the stack's name or its unique stack ID.
       
      * Deleted stacks: You must specify the unique stack ID.
      

      

    
    :type NextToken: string
    :param NextToken: 

      The token for the next set of items to return. (You received this token from a previous call.)

      

    
    
    :rtype: list(:py:class:`cloudformation.Stack`)
    :returns: A list of Stack resources
    

  .. py:method:: limit(**kwargs)

    Creates an iterable up to a specified amount of Stack resources in the collection.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks>`_    


    **Request Syntax**
    ::

      stack_iterator = cloudformation.stacks.limit(
          count=123
      )
      
    :type count: integer
    :param count: The limit to the number of resources in the iterable.

    
    
    :rtype: list(:py:class:`cloudformation.Stack`)
    :returns: A list of Stack resources
    

  .. py:method:: page_size(**kwargs)

    Creates an iterable of all Stack resources in the collection, but limits the number of items returned by each service call by the specified amount.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeStacks>`_    


    **Request Syntax**
    ::

      stack_iterator = cloudformation.stacks.page_size(
          count=123
      )
      
    :type count: integer
    :param count: The number of items returned by each service call

    
    
    :rtype: list(:py:class:`cloudformation.Stack`)
    :returns: A list of Stack resources
    