CloudFormation now allows 300,000 stacks. Can you find them?
On 20 November 2026, AWS raised the default CloudFormation stacks quota from 2,000 to 300,000 per account and per Region. For almost everyone, the stack limit is gone.
That’s good news. It also removes something many teams relied on without noticing. When an account got close to 2,000 stacks, deployments started failing, and someone had to clean up. The limit acted as a rough alarm. At 300,000, that alarm will never go off for most accounts, and stacks nobody owns can pile up for years.
This guide covers what changed, what didn’t, and how to keep track of your stacks now that the limit won’t make you.
What changed
The default stacks quota is now 300,000 per account, per Region. The old default was 2,000.
- It’s applied automatically. You don’t need to request it.
- There’s no additional charge.
- It applies in every Region where CloudFormation is available.
- It covers stacks however they’re created: the console, the AWS CLI, the SDKs, the CDK and SAM.
You can check the value CloudFormation reports for your account with describe-account-limits. The quota is per Region, so pass the Region you care about:
aws cloudformation describe-account-limits --region eu-west-2 \
--query "AccountLimits[?Name=='StackLimit'].Value" --output text
The StackLimit entry should read 300000. You can also see the quota in the Service Quotas console, under AWS CloudFormation. The CloudFormation quotas page lists it too.
Who it helps
Some designs used to hit 2,000 stacks quickly. A software provider running one stack per customer is AWS’s own example: its stacks can now grow from 2,000 to 300,000 in one account and Region.
The same goes for one stack per environment, per pull request or per developer. Teams that split these across extra accounts only to stay under the limit no longer need to.
What it doesn’t change
Account boundaries still matter. Separate accounts limit the blast radius of a mistake, keep permissions apart and make billing clearer. None of that depends on the stack quota. Don’t merge accounts just because the limit has gone. What has changed is narrower: the old limit forcing a split is no longer a reason to go multi-account.
Per-template limits are unchanged. A single template can still have:
| Limit | Value |
|---|---|
| Resources | 500 |
| Parameters | 200 |
| Outputs | 200 |
| Mappings | 200 |
| Template body passed inline | 51,200 bytes |
| Template body in Amazon S3 | 1 MB |
| Stack name | 128 characters |
StackSets limits are unchanged as well: 1,000 stack sets per administrator account, and 100,000 stack instances per stack set.
Why stack sprawl gets worse from here
The old limit made you clean up. The new one won’t. An orphaned stack still costs you, even when nothing is failing:
- Its resources are still billed. A forgotten NAT gateway, database or load balancer costs the same whether anyone remembers it or not.
- Other stacks may depend on it. If it exports outputs, other stacks can import them with
Fn::ImportValue. Nobody knows that until they try to delete it and the delete fails. - Its IAM roles go unreviewed. Roles and policies created by a stack keep their permissions. If nobody owns the stack, nobody checks them.
- It drifts. Someone changes a resource by hand to fix an incident. The template no longer matches what’s running, and nobody updates either.
At 2,000 stacks, these problems hit a ceiling. At 300,000, they keep growing.
Taking an inventory with the AWS CLI
Everything below is read-only and uses the AWS CLI. Each command works on one account, with whatever credentials you’re using.
List active stacks in every Region
list-stacks returns stacks in one Region. Two things to know about it:
- Without a status filter, it also returns stacks deleted in the last 90 days, with status
DELETE_COMPLETE. - Nested stacks appear as stacks in their own right. They have
ParentIdandRootIdset.
This script loops over every Region enabled for the account and writes one CSV row per stack that isn’t deleted:
#!/usr/bin/env bash
# list-active-stacks.sh
# One CSV row per CloudFormation stack that isn't deleted, in every enabled Region.
# Read-only: needs ec2:DescribeRegions and cloudformation:ListStacks.
#
# Usage: ./list-active-stacks.sh > stacks.csv
set -euo pipefail
# Every stack status except DELETE_COMPLETE.
STATUSES=(
CREATE_IN_PROGRESS CREATE_FAILED CREATE_COMPLETE
ROLLBACK_IN_PROGRESS ROLLBACK_FAILED ROLLBACK_COMPLETE
DELETE_IN_PROGRESS DELETE_FAILED
UPDATE_IN_PROGRESS UPDATE_COMPLETE_CLEANUP_IN_PROGRESS UPDATE_COMPLETE UPDATE_FAILED
UPDATE_ROLLBACK_IN_PROGRESS UPDATE_ROLLBACK_FAILED
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS UPDATE_ROLLBACK_COMPLETE
REVIEW_IN_PROGRESS
IMPORT_IN_PROGRESS IMPORT_COMPLETE
IMPORT_ROLLBACK_IN_PROGRESS IMPORT_ROLLBACK_FAILED IMPORT_ROLLBACK_COMPLETE
)
# Region used to look up the Region list: your configured one, or us-east-1.
HOME_REGION="${AWS_REGION:-${AWS_DEFAULT_REGION:-us-east-1}}"
REGIONS=$(aws ec2 describe-regions --region "$HOME_REGION" \
--query 'Regions[].RegionName' --output text)
echo "region,stack_name,status,created,last_updated"
for REGION in $REGIONS; do
if ! ROWS=$(aws cloudformation list-stacks --region "$REGION" \
--stack-status-filter "${STATUSES[@]}" \
--query 'StackSummaries[].[StackName, StackStatus, CreationTime, LastUpdatedTime || CreationTime]' \
--output text); then
echo "warning: could not list stacks in $REGION, skipping" >&2
continue
fi
[[ -z "$ROWS" ]] && continue
while IFS=$'\t' read -r NAME STATUS CREATED UPDATED; do
printf '%s,%s,%s,%s,%s\n' \
"$REGION" "$NAME" "$STATUS" "${CREATED:0:10}" "${UPDATED:0:10}"
done <<< "$ROWS"
done
Run it and save the output:
chmod +x list-active-stacks.sh
./list-active-stacks.sh > stacks.csv
The result looks like this:
region,stack_name,status,created,last_updated
eu-west-2,orders-api-prod,UPDATE_COMPLETE,2023-02-14,2026-11-02
eu-west-2,orders-api-staging,UPDATE_COMPLETE,2023-02-14,2025-06-19
eu-west-2,vpc-experiment,ROLLBACK_COMPLETE,2025-11-19,2025-11-19
us-east-1,billing-worker,REVIEW_IN_PROGRESS,2026-03-08,2026-03-08
A stack that has never been updated has no LastUpdatedTime, so the script uses its creation date instead. Stack names can only contain letters, numbers and hyphens, so they never break the CSV.
To see the stacks you deploy directly and leave out nested stacks, filter on ParentId in the query: StackSummaries[?!ParentId].[...]. Judge a nested stack by its root.
Find stale and stuck stacks
A stale stack is one nobody has deployed to in a long time. This lists stacks not updated in six months. It works with GNU date (Linux) and BSD date (macOS):
CUTOFF=$(date -u -d '6 months ago' +%Y-%m-%d 2>/dev/null || date -u -v-6m +%Y-%m-%d)
awk -F, -v cutoff="$CUTOFF" 'NR > 1 && $5 < cutoff' stacks.csv
Stale isn’t the same as unused. A VPC stack can go years without an update because it’s doing its job. Treat the list as questions to ask, not stacks to delete.
Stuck stacks are clearer. Three statuses are worth looking for:
awk -F, '$3 ~ /^(ROLLBACK_COMPLETE|UPDATE_ROLLBACK_FAILED|REVIEW_IN_PROGRESS)$/' stacks.csv
ROLLBACK_COMPLETE: the create failed and rolled back. The stack can’t be updated. Its only remaining use is to be deleted.UPDATE_ROLLBACK_FAILED: an update failed, and so did the rollback. Someone needs to fix the cause and runcontinue-update-rollback, or delete the stack.REVIEW_IN_PROGRESS: a change set created the stack but was never executed. The stack is empty. Reviewing CloudFormation change sets in GitHub Actions has a scheduled job that warns about these.
Find stacks with no owner
If your stacks carry an owner tag, the Resource Groups Tagging API can list them for a Region:
aws resourcegroupstaggingapi get-resources --region eu-west-2 \
--resource-type-filters cloudformation:stack \
--tag-filters Key=owner \
--query 'ResourceTagMappingList[].ResourceARN' --output text \
| tr '\t' '\n' | cut -d/ -f2 | sort -u > owned.txt
The API only returns resources that have, or once had, tags. A stack that was never tagged won’t appear at all. So compare its output with the full list from stacks.csv. Whatever is in the full list but not in owned.txt has no owner tag:
awk -F, 'NR > 1 && $1 == "eu-west-2" {print $2}' stacks.csv | sort -u > active.txt
comm -23 active.txt owned.txt
Drop --tag-filters to see every stack the API knows about, with all its tags.
Check for drift
Drift detection compares a stack’s resources with its template. It runs in the background, so you start it, wait, then read the result:
REGION=eu-west-2
STACK=orders-api-prod
ID=$(aws cloudformation detect-stack-drift --region "$REGION" \
--stack-name "$STACK" --query StackDriftDetectionId --output text)
while [[ "$(aws cloudformation describe-stack-drift-detection-status --region "$REGION" \
--stack-drift-detection-id "$ID" --query DetectionStatus --output text)" \
== DETECTION_IN_PROGRESS ]]; do
sleep 5
done
aws cloudformation describe-stack-drift-detection-status --region "$REGION" \
--stack-drift-detection-id "$ID" \
--query '[StackDriftStatus, DriftedStackResourceCount]' --output text
DRIFTED means at least one resource no longer matches the template. To see which ones:
aws cloudformation describe-stack-resource-drifts --region eu-west-2 \
--stack-name orders-api-prod \
--stack-resource-drift-status-filters MODIFIED DELETED
Not every resource type supports drift detection, so IN_SYNC tells you about the resources that were checked, not all of them.
Linking every stack back to Git
An inventory tells you what exists. It doesn’t tell you where it came from. The cheapest fix is to tag each stack when you deploy it, with its owner and the template that created it:
aws cloudformation deploy \
--region eu-west-2 \
--stack-name orders-api-prod \
--template-file stacks/orders-api.yaml \
--tags owner=<team> source-repo=<owner>/<repo> source-path=stacks/orders-api.yaml env=prod
CloudFormation propagates stack tags to the resources in the stack that support tags. So the same tags appear on the database, the queue and the IAM role, not just the stack. When you find an unfamiliar resource, its tags point to the stack, and the stack’s tags point to the file in Git.
To read them back:
aws cloudformation describe-stacks --region eu-west-2 \
--stack-name orders-api-prod --query 'Stacks[0].Tags' --output table
With these tags in place, every stack can be traced to the template that created it. A stack whose source-path no longer exists in its repository is easy to spot.
Ways to keep stacks tied to Git
Tags record the link once. Keeping it true over time takes one of a few approaches.
Do it yourself. Tag stacks with their repository, path and owner at deploy time, as above, and run the inventory commands on a schedule. It’s free, and you can shape it to fit how your team works. The trade-off is that someone has to maintain the scripts and act on what they find.
CloudFormation Git sync. This is AWS’s built-in option. Each configuration watches one repository and one branch, and manages one stack, applying new commits to it. It’s native to AWS, and the sync itself carries no charge. Removing a template from the repository doesn’t remove the deployed stack, so deletion is a separate step. How Stackmuster compares with CloudFormation Git sync covers it in more detail.
Stackmuster. It scans connected repositories for CloudFormation templates and creates a deployment for each one. Every change is planned before it’s applied. When a template is removed, its stack is deleted once the deletion is approved. There’s a free tier and paid plans; see pricing.
A simple policy you can adopt
You don’t need a platform team to keep this under control. Four rules go a long way:
- Every stack has an owner tag and source tags. Add them in the pipeline, so nobody has to remember.
- Review stale stacks monthly. Run the inventory, sort by
last_updated, and ask the owner of anything older than your cut-off. - A stack with no template in Git is a candidate for deletion. Check what it holds and what depends on it first. Deleting CloudFormation stacks when the template is removed from Git covers how to do that safely.
- Turn on termination protection only where it’s needed. Use it on stacks that hold data you can’t lose. On everything else it mostly gets in the way of clean-up.
aws cloudformation update-termination-protection --region eu-west-2 \
--enable-termination-protection --stack-name orders-api-prod
For a deeper inventory, with tags and flags in one report, use the script in Finding forgotten CloudFormation stacks in your AWS account. It also covers stacks this guide doesn’t, such as StackSet instances and stacks created by AWS tools.
If some of your stacks came from AWS Proton, which reached end of support on 7 October 2026, the Proton migration guide explains what happens to them.
If you’d rather not maintain this yourself
The inventory commands give you a snapshot of one moment. Keeping every stack tied to a template in Git keeps that picture current, using any of the options above.
Sources
- AWS What’s New: AWS CloudFormation increases the default stacks per account quota
- AWS CloudFormation User Guide: CloudFormation quotas
- AWS CLI reference: describe-account-limits, list-stacks, describe-regions, describe-stacks, deploy
- AWS CLI reference: detect-stack-drift, describe-stack-drift-detection-status, describe-stack-resource-drifts
- AWS CLI reference: continue-update-rollback, update-termination-protection
- AWS CLI reference: resourcegroupstaggingapi get-resources
- Resource Groups Tagging API Reference: GetResources