watchrs

Crates.iowatchrs
lib.rswatchrs
version0.2.1
sourcesrc
created_at2019-04-23 00:33:10.854659
updated_at2019-04-24 02:27:52.963708
descriptionCrate that aids in monitoring and setting up alerts for AWS Batch Jobs.
homepagehttps://github.com/itsHabib/watchrs
repositoryhttps://github.com/itsHabib/watchrs.git
max_upload_size
id129572
size37,731
Michael Habib (itsHabib)

documentation

https://docs.rs/watchrs

README

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.

Commit count: 33

cargo fmt