Run cdk list or cdk ls from a CDK application directory to list the stacks declared by that app. This is a local application inventory, not a list of every CloudFormation stack deployed in your account.
Inspect app stacks and environments
npx aws-cdk list npx aws-cdk list --long npx aws-cdk list --show-dependencies
--long includes the configured environment. --show-dependencies includes relationships between app stacks. The app must be executable through its cdk.json command or an explicit --app argument.
An environment-agnostic stack may not have a concrete account and region yet. Set the stack's env in code when its behavior requires a specific environment, as in VPC lookup.
Check deployed status separately
To list deployed stacks in an AWS account and region:
aws cloudformation list-stacks --region YOUR_REGION \ --stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE \ --query 'StackSummaries[].{Name:StackName,Status:StackStatus}'
This command covers the selected statuses, not all possible stack states. Add relevant statuses or omit the filter for your investigation. Use describe-stacks --stack-name YOUR_STACK_NAME for details of one stack.
The -e prod, -r REGION, and --status filters previously shown for cdk list were incorrect. Consult the official cdk list reference for supported options. Your AWS CLI profile and region select the account context for CloudFormation queries.
Troubleshooting
If listing fails, inspect the app command, TypeScript compilation errors, and credentials required by synthesis-time lookups. Executing a CDK app can perform context lookups even when you only want to list its stacks; app constructors should not perform unrelated external writes.
After confirming the stack IDs, use cdk diff to review changes and deploy all stacks to select the intended deployment scope. Listing alone does not deploy resources.
Quick Recap
Does cdk list show deployed stack status?
No. It lists stacks defined by the local CDK app. Use AWS CloudFormation list-stacks or describe-stacks for deployment status.
How do you see a CDK stack's account and region?
Use cdk list --long. The environment comes from the app configuration; it is not proof that a stack is deployed there.
Comments
Share your thoughts and questions below