Radiosonde is a tool to manage CloudWatch Alarm. It defines the state of CloudWatch Alarm using DSL, and updates CloudWatch Alarm according to DSL.
Ruby
Latest commit ffa5e43 Jan 10, 2017 @winebarrel winebarrel committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
bin Update to aws-sdk v2 Aug 22, 2016
lib Bump up version [ci skip] Aug 23, 2016
spec etc... Aug 10, 2014
.gitignore etc... Aug 10, 2014
.rspec etc... Aug 10, 2014
Gemfile first commit Aug 10, 2014
LICENSE.txt first commit Aug 10, 2014
README.md Update README.md Jan 10, 2017
Rakefile etc... Aug 10, 2014
radiosonde.gemspec Update to aws-sdk v2 Aug 22, 2016

README.md

Radiosonde

Radiosonde is a tool to manage CloudWatch Alarm.

It defines the state of CloudWatch Alarm using DSL, and updates CloudWatch Alarm according to DSL.

Gem Version

Installation

Add this line to your application's Gemfile:

gem 'radiosonde'

And then execute:

$ bundle

Or install it yourself as:

$ gem install radiosonde

Usage

export AWS_ACCESS_KEY_ID='...'
export AWS_SECRET_ACCESS_KEY='...'
export AWS_REGION='us-east-1'
radiosonde -e -o Alarmfile  # export CloudWatch Alarm
vi Alarmfile
radiosonde -a --dry-run
radiosonde -a               # apply `Alarmfile` to CloudWatch

Help

Usage: radiosonde [options]
    -p, --profile PROFILE_NAME
    -k, --access-key ACCESS_KEY
    -s, --secret-key SECRET_KEY
    -r, --region REGION
    -a, --apply
    -f, --file FILE
        --dry-run
    -e, --export
    -o, --output FILE
        --show-metrics
        --show-dimensions
        --show-statistics
        --namespace NAMESPACE
        --metric-name NAME
        --start-time TIME
        --end-time TIME
        --statistic STATISTIC
        --include REGEXP
        --exclude REGEXP
        --no-color
        --debug

Alarmfile example

require 'other/alarmfile'

alarm "alarm1" do
  namespace "AWS/EC2"
  metric_name "CPUUtilization"
  dimensions "InstanceId"=>"i-XXXXXXXX"
  period 300
  statistic :average
  threshold ">=", 50.0
  evaluation_periods 1
  actions_enabled true
  alarm_actions []
  ok_actions []
  insufficient_data_actions ["arn:aws:sns:us-east-1:123456789012:my_topic"]
end

alarm "alarm2" do
  ...
end

Use template

template "basic" do
  namespace "AWS/EC2"
  metric_name "CPUUtilization"
  dimensions "InstanceId"=>"i-XXXXXXXX"
  period 300
  statistic :average
  threshold ">=", 50.0
  evaluation_periods 1
  actions_enabled true
  alarm_actions []
  ok_actions []
  insufficient_data_actions [context[:sns_topic]]
end

alarm "alarm1" do
  include_template "basic", :sns_topic=>"arn:aws:sns:us-east-1:123456789012:my_topic"
end

alarm "alarm2" do
  context.sns_topic = "arn:aws:sns:us-east-1:123456789012:my_topic2"
  include_template "basic"
end

Similar tools