Delete in reverse order of creation: on AWS 24 , booknest-web cannot go while booknest-app imports its exports (The Export Deletion Trap). Empty the bucket first, too, because CloudFormation 24 never deletes objects and a non-empty bucket leaves its stack in DELETE_FAILED:
aws cloudformation delete-stack --stack-name booknest-app
aws cloudformation wait stack-delete-complete --stack-name booknest-app
aws s3 rm s3://booknest-web-000000000000 --recursive --only-show-errors
aws cloudformation delete-stack --stack-name booknest-web
aws cloudformation wait stack-delete-complete --stack-name booknest-web
aws cloudformation list-stacks --output text --query \
"StackSummaries[?starts_with(StackName,'booknest-')].[StackName,StackStatus]"
aws dynamodb list-tables --query 'length(TableNames)'
aws lambda list-functions --query 'length(Functions)'
aws logs describe-log-groups --query 'length(logGroups)'
aws iam get-role --role-name booknest-api 2>&1 | grep -o 'NoSuchEntity.*'
aws s3api list-buckets --query 'length(Buckets)'
aws ec2 describe-vpcs --filters Name=tag:Name,Values=booknest-vpc --query 'length(Vpcs)'booknest-web DELETE_COMPLETE booknest-app DELETE_COMPLETE 0 0 0 NoSuchEntity) when calling the GetRole operation: Role booknest-api not found 0 0
Nothing is orphaned, but one zero is wrong: 4.13.1 ignored the table's DeletionPolicy: Retain (Deletion Policies). On AWS booknest-books would survive, and deleting it is a deliberate aws dynamodb delete-table, after which a free system backup is kept for 35 days. Retained resources are orphans you choose; list them before deleting.
On AWS, a VPC-attached function's network interfaces take up to 20 minutes to go, holding its subnets and security group; if its role goes first, you remove them by hand. After a DELETE_FAILED, describe-stack-events names the culprit and --retain-resources (delete-stack) finishes the rest. On LocalStack 63,725 , deleting booknest-web first succeeded, full bucket and all, and the application stack's deletion then failed with InternalError and stuck in DELETE_IN_PROGRESS.