{"id":20471870,"url":"https://github.com/signiant/cf-stack-remover","last_synced_at":"2026-06-07T15:31:50.017Z","repository":{"id":93379978,"uuid":"162491999","full_name":"Signiant/cf-stack-remover","owner":"Signiant","description":"CloudFormation Stack Remover","archived":false,"fork":false,"pushed_at":"2019-01-10T16:49:57.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-16T02:24:23.114Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Signiant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-19T21:19:47.000Z","updated_at":"2019-01-10T16:49:59.000Z","dependencies_parsed_at":"2023-07-03T20:00:26.143Z","dependency_job_id":null,"html_url":"https://github.com/Signiant/cf-stack-remover","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fcf-stack-remover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fcf-stack-remover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fcf-stack-remover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fcf-stack-remover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Signiant","download_url":"https://codeload.github.com/Signiant/cf-stack-remover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039604,"owners_count":20061925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T14:17:27.487Z","updated_at":"2026-06-07T15:31:49.939Z","avatar_url":"https://github.com/Signiant.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cf-stack-remover\ndelete specified stacks from cloudformation\n\n# Purpose\nRemove CloudFormation stacks from Amazon services. At time when manually deleting the stacks is possiblem it's certainly a pain. Obviously the solution is to automate the process. This solution will perform the following ways to delete the stacks within CloudFormation:\n* Group delete stacks based on the StackStatus of the stacks\n* Group delete Stacks based on the regex string which match a set of stacks\n* Group delete \n\n# Prerequisites\n* Python installed\n* boto3 module instsalled\n* Either an AWS role (if running on EC2) or an access key/secret key\n\n# AWS Lambda/Cloudformation deployment\n\nManually creation of the template.yaml file\n\n```\naws cloudformation package \\\n    --template-file template.yaml \\\n    --s3-bucket dev2-useast1-lambda-deploy \\\n    --s3-prefix lambda-stack-remover \\\n    --output-template-file packaged-template.yaml \\\n    --profile dev2\n```\nAbove command put template in bucket and stored at dev2-uswest2-lambda-deploy at lambda-stack-remover folder at dev2 user\n\n```\naws cloudformation deploy  \\\n  --capabilities CAPABILITY_IAM \\\n  --template-file ./packaged-template.yaml  \\\n  --stack-name cloudformation-stack-remover  \\\n  --parameter-overrides StackStatus=ROLLBACK_COMPLETE ContainString=.* Dryrun=False Region=us-east-1 ExpireDays=30  \\\n  --profile dev2  \\\n  --region us-east-1\n```\n\n# Usage\n\nThe easiest way to run the tool is from docker (because docker rocks) or from any python environment.\nYou will need to pass in variables specific to the ECS task you want to affect\n\n```\nusage: lambda_cf_delete_stacks.py [-h] --stack-status STACK_STATUS\n                                  [STACK_STATUS ...]\n                                  [--contain-string CONTAIN_STRING]\n                                  [--expire-days EXPIRE_DAYS] --region REGION\n                                  [--profile PROFILE] [--verbose] [--dryrun]\n\nPerform deletion on AWS cloudformation stacks based on criterias listed\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --stack-status STACK_STATUS [STACK_STATUS ...]\n                        Stack status match to be deleted StackName. Example:\n                        ROLLBACK_COMPLETE\n  --contain-string CONTAIN_STRING\n                        Regex String that match to be deleted StackName.\n                        Example: 'A.*'\n  --expire-days EXPIRE_DAYS\n                        days since creation of the stack to be deleted.\n                        Example: 30 will delete all stacks that are older than\n                        30 days\n  --region REGION       The AWS region the stack is in\n  --profile PROFILE     The name of an aws cli profile to use.\n  --verbose             Turn on DEBUG logging\n  --dryrun              Do a dryrun - no changes will be performed\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fcf-stack-remover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigniant%2Fcf-stack-remover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fcf-stack-remover/lists"}