Giter Club home page Giter Club logo

cloud-aws-cloudformation-cleaner-js's Introduction

AWS CloudFormation Cleaner

GitHub Actions semantic-release Renovate @commitlint/config-conventional code style: prettier ESLint: TypeScript

This is a CDK project written in TypeScript that sets up a CloudFormation stack which cleans up left-over stacks and log groups from CI runs.

Although your CI tests should clean up after themselves, there still might be stacks and log groups that get not cleaned up perfectly. This stack runs a lambda every hour, which deletes stacks and log groups that have a certain prefix and are older than 24 hours.

Install

git clone https://github.com/bifravst/cloudformation-cleaner
npm ci

Setup in your CI account

Note: you should only set this up in an account where every CloudFormation stack can be deleted, because this lambda has the permissions to delete everything.

npx cdk deploy

Configuration

You can configure the regular expression used to check against a resources names according to the following table

Lambda SSM Parameter Name
stack-cleaner /${stackName}/stackNameRegEx
log-group-cleaner /${stackName}/logGroupNameRegEx
role-cleaner /${stackName}/roleNameRegEx
buckets-cleaner /${stackName}/bucketNameRegEx
parameter-cleaner /${stackName}/parameterNameRegEx

You can configure this from the command line:

aws ssm put-parameter --name /cloudformation-cleaner/stackNameRegEx --value '^(some-pattern|another-pattern)-' --overwrite

Running from the command line

npx tsx ./cli.ts

cloud-aws-cloudformation-cleaner-js's People

Contributors

coderbyheart avatar dependabot[bot] avatar greenkeeper[bot] avatar renovate-bot avatar renovate[bot] avatar snyk-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloud-aws-cloudformation-cleaner-js's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Fallback to renovate.json file as a preset is deprecated, please use a default.json file instead.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/sync-issue-labels.yaml
  • actions/checkout v4
  • ubuntu 22.04
.github/workflows/test-and-release.yaml
  • actions/checkout v4
  • actions/setup-node v4
  • ubuntu 22.04
.github/workflows/update-repo-info.yaml
  • actions/checkout v4
  • ubuntu 22.04
npm
package.json
  • @aws-sdk/client-cloudwatch-logs 3.614.0
  • @aws-sdk/client-iam 3.614.0
  • @aws-sdk/client-s3 3.614.0
  • @aws-sdk/client-ssm 3.614.0
  • @bifravst/cloudformation-helpers 9.1.1
  • @bifravst/from-env 3.0.2
  • @aws-sdk/client-cloudformation 3.614.0
  • @aws-sdk/client-lambda 3.614.0
  • @bifravst/eslint-config-typescript 6.1.10
  • @bifravst/prettier-config 1.0.4
  • @commitlint/config-conventional 19.2.2
  • @swc/cli 0.4.0
  • @swc/core 1.7.0
  • @types/glob 8.1.0
  • @types/node 20.14.11
  • @types/yazl 2.4.5
  • aws-cdk-lib 2.149.0
  • cdk 2.149.0
  • constructs 10.3.0
  • glob 11.0.0
  • husky 9.1.1
  • tsx 4.16.2
  • yazl 2.5.1
  • node >=20
  • npm >=10

  • Check this box to trigger a request for Renovate to run again on this repository

The automated release is failing 🚨

🚨 The automated release from the saga branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the saga branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch saga on the remote Git repository with URL https://github.com/NordicSemiconductor/cloud-aws-cloudformation-cleaner-js.git.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.