Coder Social home page Coder Social logo

aws-janitor's Introduction

AWS Janitor

A GitHub Action to cleanup AWS resources that have exceeded a TTL.

By default the action will not perform the delete (i.e. it will be a dry-run). You need to explicitly set commit to true.

It supports cleaning up the following services:

  • EKS Clusters
  • Auto Scaling Groups

Inputs

Name Required Description
regions Y A comma seperated list of regions to clean resources in. You can use * for all regions
allow-all-regions N Set to true if use * from regions.
ttl Y The duration that a resource can live for. For example, use 24h for 1 day.
commit N Whether to perform the delete. Defaults to false which is a dry run

Example Usage

jobs:
  cleanup:
    runs-on: ubuntu-latest
    name: Cleanup resource groups
    steps:
      - name: Cleanup
        uses: rancher-sandbox/[email protected]
        with:
            regions: eu-west-1
            ttl: 168h
        env:
            AWS_ACCESS_KEY_ID: {{secrets.AWS_ACCESS_KEY_ID}}
            AWS_SECRET_ACCESS_KEY: {{secrets.AWS_SECRET_ACCESS_KEY}}

Implementation Notes

It currently assumes that an instance of a service will have some form of creation date. This means that the implementation can be simpler as it doesn't need to adopt a "mark & sweep" pattern that requires saving state between runs of the action.

aws-janitor's People

Contributors

richardcase avatar

Watchers

 avatar

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.