Giter VIP home page Giter VIP logo

odin's Introduction

Build statusKnown VulnerabilitiesDependency StatusdevDependency StatusLicenseCode style

Odin

Odin, or Wōtan, is a Norse god who directs the valkyries and is the guardian of Valhalla. Half of those who perish in combat are welcomed by him into his majestic halls where they prepare for the final battle against Fenrir during the events of Ragnarök.

What it does

This serverless application periodically checks the status of CloudFormation stacks in your AWS environment and sends the stale ones to Valhalla.

Odin currently determines that a stack is stale and should be removed when it doesn't fit any of the following three criteria:

  1. Tagging: If a stack is tagged with the stage 'Production' or 'Automation' (or either's derivatives, like 'Prod' or 'Auto') then it is ineligible for deletion
  2. Status: If a stack's status is in a failure or in-progress state then it is ineligible for deletion
  3. Age: If a stack has been updated recently then it is ineligible for deletion

If a stack doesn't match one of the above criteria then it is removed.

How to use it

Odin is built with the Serverless Framework - see their documentation for more about the tool and how to use it.

To change the frequency with which Odin runs and the settings used to determine whether a stack is eligible for deletion modify the values in odin.yml and redeploy the application.

Limitations

Unlike his Norse namesake Odin is unable to practice magic and cannot remove stacks that aren't self-removing.

A common example of this situation is a stack which creates an S3 bucket that is later filled with files. If the stack doesn't contain the resources necessary to empty and then delete this bucket any stack delete commands (whether triggered by Odin, manually, or any other means) will end with the stack in an error state. Don't treat your stacks this way - let them enter Valhalla with honor!

For this specific scenario you can use a tool like the empty-s3-bucket service found in Lambda Utilities in combination with a custom CloudFormation resource to empty buckets when a stack is deleted. See the infrastructure section of Santa Swap UI for a real-world example of how this can be achieved within a stack.

Another approach is to let Odin empty your S3 buckets for you prior to calling the delete stack command. This approach requires you to output the bucket name in your CloudFormation stack, and then add the output key name to odin.yml. By default Odin will empty the deployment buckets created by the Serverless Framework.

Architecture overview

odin - architecture overview

Odin image source

Murray, Alexander (1874). Manual of Mythology : Greek and Roman, Norse, and Old German, Hindoo and Egyptian Mythology. London, Asher and Co. This illustration is from plate XXXV. Digitized version of the book by the Internet Archive, https://archive.org/details/manualofmytholog00murruoft Published earlier in Reusch, Rudolf Friedrich. 1865. Die nordischen Göttersagen.

odin's People

Contributors

manwaring avatar jackwarner avatar

Watchers

 avatar James Cloos avatar  avatar Nick Stephens avatar Paul Sambolin avatar  avatar

odin's Issues

Deploy odin via child-pipelines, aka, 'the sls rails'

The most compelling use case is having odin on by default for individual or small-team dev accounts.

By tearing down old stacks, odin will both control cost and ensure that non-rails habits aren't creeping in to your development process. If they did, you'd end up breaking higher level environments with your services.

Oh, and in the 'rails' world, no individual IAM user has the ability to create a service directly - they can only upload secrets.

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.