Skip to content

itsHabib/watchrs

Repository files navigation

watchrs

Crates.io Documentation Build Status

watchrs is a crate that aids in monitoring and setting up alerts for AWS Batch Jobs.

Note: This is still under development and I would not consider it to be production ready yet.

Examples

Setting Up Alerts For Batch Job State Changes

use watchrs::Watcher;

// First create and subscribe to a topic
let watcher = Watcher::default();
watcher
    .subscribe("youremail@example.com".to_owned(), None)
    .and_then(|(topic_arn, _)| {
        watcher
            .create_job_watcher_rule(
                "my_batch_job_rule".to_owned(),
                // enable?
                true,
                Some("watch failed jobs".to_owned()),
                Some(vec!["FAILED".to_owned(), "RUNNABLE".to_owned()]),
                Some(vec!["JOB_QUEUE_ARN".to_owned()]),
                Some(vec!["JOB_DEFINITION_NAME".to_owned()])
            )
            .map(|rule_name| (topic_arn, rule_name))
    })
      .and_then(|(topic_arn, rule_name)| {
           // create target
           watcher.create_sns_target(rule_name, topic_arn)
    })
    .expect("failed to create alerting system");

Requirements

  • AWS Account
  • AWS CLI configured

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

A crate that aids in monitoring and setting up alerts for AWS Batch Jobs.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages