AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Table Of Contents

Feedback

[ aws . cloudformation ]

list-stacks

Description

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 --stack-status-filter is specified, summary information for all stacks is returned (including existing stacks and stacks that have been deleted).

Synopsis

  list-stacks
[--stack-status-filter <value>]
[--starting-token <value>]
[--max-items <value>]

Options

--stack-status-filter (list)

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.

Syntax:

"string" "string" ...

Where valid values are:
  CREATE_IN_PROGRESS
  CREATE_FAILED
  CREATE_COMPLETE
  ROLLBACK_IN_PROGRESS
  ROLLBACK_FAILED
  ROLLBACK_COMPLETE
  DELETE_IN_PROGRESS
  DELETE_FAILED
  DELETE_COMPLETE
  UPDATE_IN_PROGRESS
  UPDATE_COMPLETE_CLEANUP_IN_PROGRESS
  UPDATE_COMPLETE
  UPDATE_ROLLBACK_IN_PROGRESS
  UPDATE_ROLLBACK_FAILED
  UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS
  UPDATE_ROLLBACK_COMPLETE

--starting-token (string)

A token to specify where to start paginating. This is the --next-token from a previously truncated response.

--max-items (integer)

The total number of items to return. If the total number of items available is more than the value specified in max-items then a --next-token will be provided in the output that you can use to resume pagination.

Examples

To list AWS CloudFormation stacks

The following list-stacks command shows a summary of all stacks that have a status of CREATE_COMPLETE:

aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE

Output:

[
    {
        "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896",
        "TemplateDescription": "AWS CloudFormation Sample Template S3_Bucket: Sample template showing how to create a publicly accessible S3 bucket. **WARNING** This template creates an S3 bucket. You will be billed for the AWS resources used if you create a stack from this template.",
        "StackStatusReason": null,
        "CreationTime": "2013-08-26T03:27:10.190Z",
        "StackName": "myteststack",
        "StackStatus": "CREATE_COMPLETE"
    }
]

Output

StackSummaries -> (list)

A list of StackSummary structures containing information about the specified stacks.

(structure)

The StackSummary Data Type

StackId -> (string)

Unique stack identifier.

StackName -> (string)

The name associated with the stack.

TemplateDescription -> (string)

The template description of the template used to create the stack.

CreationTime -> (timestamp)

The time the stack was created.

LastUpdatedTime -> (timestamp)

The time the stack was last updated. This field will only be returned if the stack has been updated at least once.

DeletionTime -> (timestamp)

The time the stack was deleted.

StackStatus -> (string)

The current status of the stack.

StackStatusReason -> (string)

Success/Failure message associated with the stack status.

NextToken -> (string)

String that identifies the start of the next list of stacks, if there is one.