Orphaned CloudFormation Stacks — HouseKeeping | DevsDay.ru

IT-блоги Orphaned CloudFormation Stacks — HouseKeeping

dev.to 11 июня 2021 г.


  • There could be some stacks missed out during teardown process due to some issues and this might leave those stacks orphaned.
  • Also when App teams create a new stack without deleting their previous stack, this will leave the previous stack orphaned.


  • List out all the stacks based on the state in the corresponding account using below python script. Filter the suspecting orphaned stacks from the list.
# Function: EvaluateOrphanedStacks
# Purpose: List out stacks based on the state and accounts
import boto3
import json
from datetime import datetime
from datetime import date
def list_stacks():
paginator = cfn_client.get_paginator('list_stacks')
response_iterator = paginator.paginate(
for page in response_iterator:
for stack in page['StackSummaries']:
if __name__ == '__main__':

Its ALWAYS recommended and good practice to reduce the orphaned stacks and unwanted resources !

Источник: dev.to

Наш сайт является информационным посредником. Сообщить о нарушении авторских прав.

aws cloudformation housekeeping cost