Giter Club home page Giter Club logo

broom's Introduction

BROOM

Enforce strict tagging policies on AWS EC2 instances, using Lambda.

I made this because I wanted to analyze each instance that is created on my AWS account, and destroy it if it is not properly tagged. I also wanted to get a notification when this happens. If that's what you want too, Broom will do the job for you!

Requirements

For this to work, you will need to use:

  • Cloudtrail, and an S3 bucket
  • An SNS topic
  • An IAM role
  • A Lambda function

Usage

Create a Cloudtrail trail, apply it to all regions (or the regions you want to monitor), and synchronize it with an S3 bucket of your choice. You can create an S3 bucket on the AWS console if you don't have one already.

Next, create an SNS topic for Broom notifications, and subscribe yourself to it if you want to receive notifications.

Create an IAM role for Broom, using the policy that comes with this repository. You will have to modify it and add your SNS topic ARN so that your Lambda function can interact with it.

Next up, create the function on Lambda. You can create it on the console editing the code inline, since all the used libraries are available in AWS, or you can create a function package an upload it. Set up a trigger from the previously created S3 bucket, on object creation, and increase the timeout limit. Ten seconds should do.

By default, Broom verifies if the instance is tagged with the 'Code' key, and either the 'LOL', 'GGG', "BRB' or 'YLO' values. You will probably want to change this according to your needs. If it is not, it will destroy the instance, and publish a report on the SNS topic.

See this article for detailed information: https://sebiwi.github.io/blog/broom/

This is pretty cool, thanks!

You're welcome. Any suggestions/comments are welcomed!

broom's People

Contributors

sebiwi avatar

Watchers

James Cloos avatar Jon Fuller 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.