An AWS rules engine for managing resources
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
sythe
tests
.editorconfig
.gitignore
.travis.yml
README.md
pylint.rc
requirements.txt
sythe.py

README.md

Sythe

Build Status

Coverage Status

Sythe is a rules engine for AWS resources, not unlike Janitor Monkey by Netflix, or Cloud Custodian by Capital One.

Sythe provides a Domain Specific Language in which rules are defined. This DSL is interpretted at run time by Sythe. This gives a distinct advantage over the above two offerings - we maintain most of the expressiveness of Janitor Monkey, in which rules are written in Java and compiled, while also maintaining the ease of deployment offered by Cloud Custodian (in which configurations are in YAML).

DSL

A rule in Sythe is defined as follows:

<Resource Type>(<Condition>){
    <Action>
    <Action>
}

for example the following rule will find all ec2 instances that are in a suspended state and mark them for deletion in 3 days. It will also send an email to the email address in the "owner" tag on the resource:

ec2_instance(State.Name = "suspended"){
    mark_for_deletion(after: "3 days")
    notify(transport: "ses", to: tag:owner, from: "sythe@company.com")
}

Assuming this is put in a file called "rule.sr", this can be run by simply calling sythe rule.sr.