Skip to content

Commit 3aa917e

Browse files
committed
chore(smoke-nuke): list all states; stale orphans live outside the filter set
Previous nuke listed 9 orphan all-demo-* stacks but missed all-demo-PaperlessNgx-Q59CODQ417ER and all-demo-BopsPlanning-1KFCREGSEO53T. The next PR 321 smoke retry then collided on every IAM role, ALB, ECS cluster, S3 bucket those stacks still owned. Stacks created mid-flight by the cancelled post-merge smoke (which kept running server-side after the GH job was killed) probably entered CREATE_IN_PROGRESS → UPDATE_COMPLETE_CLEANUP_IN_PROGRESS or similar windows the older filter list missed. Expand the filter to enumerate every state CFN reports — CREATE_*, ROLLBACK_*, DELETE_*, UPDATE_*, UPDATE_ROLLBACK_*, REVIEW_*, IMPORT_* including the *_CLEANUP_IN_PROGRESS suffix variants. Only DELETE_COMPLETE is excluded (those are already gone). Any orphan in any non-deleted state now reaches force_delete_stack.
1 parent d75da49 commit 3aa917e

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

scripts/smoke-nuke.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,22 @@ echo "PHASE 1: delete CFN stacks matching ${STACK}*"
109109
echo "============================================================"
110110
# Top-level stacks named STACK or STACK-*: delete each.
111111
# delete-stack on the umbrella cascades to nested children.
112+
# All non-DELETE_COMPLETE states. The earlier filter missed
113+
# UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS and the IMPORT_* family;
114+
# `Q59CODQ417ER` / `1KFCREGSEO53T` were ghosts the nuke kept skipping.
115+
# Listing every non-terminal-deleted state guarantees we see them.
112116
top_stacks=$(aws cloudformation list-stacks \
113-
--stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE UPDATE_ROLLBACK_COMPLETE \
114-
DELETE_FAILED UPDATE_ROLLBACK_FAILED CREATE_FAILED UPDATE_FAILED \
115-
ROLLBACK_COMPLETE ROLLBACK_FAILED \
117+
--stack-status-filter \
118+
CREATE_IN_PROGRESS CREATE_FAILED CREATE_COMPLETE \
119+
ROLLBACK_IN_PROGRESS ROLLBACK_FAILED ROLLBACK_COMPLETE \
120+
DELETE_IN_PROGRESS DELETE_FAILED \
121+
UPDATE_IN_PROGRESS UPDATE_COMPLETE_CLEANUP_IN_PROGRESS UPDATE_COMPLETE \
122+
UPDATE_FAILED \
123+
UPDATE_ROLLBACK_IN_PROGRESS UPDATE_ROLLBACK_FAILED \
124+
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS UPDATE_ROLLBACK_COMPLETE \
125+
REVIEW_IN_PROGRESS \
126+
IMPORT_IN_PROGRESS IMPORT_COMPLETE \
127+
IMPORT_ROLLBACK_IN_PROGRESS IMPORT_ROLLBACK_FAILED IMPORT_ROLLBACK_COMPLETE \
116128
--query "StackSummaries[?StackName=='${STACK}' || starts_with(StackName, '${STACK}-')].StackName" \
117129
--output text 2>/dev/null | tr '\t' '\n' | grep -v '^$' || true)
118130
if [ -z "$top_stacks" ]; then

0 commit comments

Comments
 (0)