{"id":20442605,"url":"https://github.com/bifravst/cloudformation-cleaner","last_synced_at":"2026-04-07T04:31:22.549Z","repository":{"id":37070260,"uuid":"333133277","full_name":"bifravst/cloudformation-cleaner","owner":"bifravst","description":"Cleans old CloudFormation stacks and log groups, e.g. from CI runs","archived":false,"fork":false,"pushed_at":"2025-06-12T16:47:17.000Z","size":14356,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":5,"default_branch":"saga","last_synced_at":"2025-06-12T17:43:07.318Z","etag":null,"topics":["aws","cloudformation","iot","nrf-asset-tracker","utility"],"latest_commit_sha":null,"homepage":"https://github.com/bifravst/cloudformation-cleaner#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bifravst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2021-01-26T15:46:21.000Z","updated_at":"2025-06-12T16:57:14.000Z","dependencies_parsed_at":"2024-01-16T04:45:03.081Z","dependency_job_id":"bad4f618-f057-4397-beb3-45484aa2454c","html_url":"https://github.com/bifravst/cloudformation-cleaner","commit_stats":null,"previous_names":["bifravst/cloudformation-cleaner"],"tags_count":569,"template":false,"template_full_name":null,"purl":"pkg:github/bifravst/cloudformation-cleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bifravst%2Fcloudformation-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bifravst%2Fcloudformation-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bifravst%2Fcloudformation-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bifravst%2Fcloudformation-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bifravst","download_url":"https://codeload.github.com/bifravst/cloudformation-cleaner/tar.gz/refs/heads/saga","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bifravst%2Fcloudformation-cleaner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260301993,"owners_count":22988722,"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":["aws","cloudformation","iot","nrf-asset-tracker","utility"],"created_at":"2024-11-15T09:41:45.332Z","updated_at":"2026-04-07T04:31:22.544Z","avatar_url":"https://github.com/bifravst.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS CloudFormation Cleaner\n\n[![GitHub Actions](https://github.com/bifravst/cloudformation-cleaner/workflows/Test%20and%20Release/badge.svg)](https://github.com/bifravst/cloudformation-cleaner/actions)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)\n[![@commitlint/config-conventional](https://img.shields.io/badge/%40commitlint-config--conventional-brightgreen)](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier/)\n[![ESLint: TypeScript](https://img.shields.io/badge/ESLint-TypeScript-blue.svg)](https://github.com/typescript-eslint/typescript-eslint)\n\nThis is a [CDK](https://github.com/aws/aws-cdk) project written in TypeScript\nthat sets up a CloudFormation stack which cleans up left-over stacks and log\ngroups from CI runs.\n\nAlthough your CI tests _should_ clean up after themselves, there still might be\nstacks and log groups that get not cleaned up perfectly. This stack runs a\nlambda every hour, which deletes stacks and log groups that have a certain\nprefix and are older than 24 hours.\n\n## Install\n\n    git clone https://github.com/bifravst/cloudformation-cleaner\n    npm ci\n\n## Setup in your CI account\n\n\u003e Note: you should only set this up in an account where every CloudFormation\n\u003e stack can be deleted, because this lambda has the permissions to delete\n\u003e everything.\n\n    npx cdk deploy --context prefix=my-prefix-\n\nYou should specify the prefix your stacks use in the context variable `prefix`.\n\n### Configuration\n\nYou can configure the regular expression used to check against a resources names\naccording to the following table\n\n| Lambda              | SSM Parameter Name                 |\n| ------------------- | ---------------------------------- |\n| `stack-cleaner`     | `/${stackName}/stackNameRegEx`     |\n| `log-group-cleaner` | `/${stackName}/logGroupNameRegEx`  |\n| `role-cleaner`      | `/${stackName}/roleNameRegEx`      |\n| `buckets-cleaner`   | `/${stackName}/bucketNameRegEx`    |\n| `parameter-cleaner` | `/${stackName}/parameterNameRegEx` |\n\nYou can configure this from the command line:\n\n```bash\naws ssm put-parameter --name /cloudformation-cleaner/stackNameRegEx --value '^(some-pattern|another-pattern)-' --type String --overwrite\naws ssm put-parameter --name /cloudformation-cleaner/parameterNameRegEx --value '^\\/(some-pattern|another-pattern)-' --type String --overwrite\n```\n\n## Running from the command line\n\n```bash\nnpm run clean\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbifravst%2Fcloudformation-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbifravst%2Fcloudformation-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbifravst%2Fcloudformation-cleaner/lists"}