Class: Chef::Handler::Sns

Inherits:
Chef::Handler show all
Includes:
Config
Defined in:
lib/chef/handler/sns.rb,
lib/chef/handler/sns/config.rb,
lib/chef/handler/sns/version.rb,
lib/chef/handler/sns/config/ohai.rb

Defined Under Namespace

Modules: Config

Constant Summary collapse

VERSION =
'1.1.0'

Constants included from Config

Config::REQUIRED

Instance Method Summary collapse

Methods included from Config

#access_key, #body_template, #config_check, #config_from_ohai, #config_init, #filter_opsworks_activity, #region, #secret_key, #subject, #token, #topic_arn

Constructor Details

#initialize(config = {}) ⇒ Sns

Returns a new instance of Sns.



29
30
31
32
# File 'lib/chef/handler/sns.rb', line 29

def initialize(config={})
  Chef::Log.debug("#{self.class.to_s} initialized.")
  config_init(config)
end

Instance Method Details

#get_regionObject



44
45
46
# File 'lib/chef/handler/sns.rb', line 44

def get_region
  sns.config.region
end

#reportObject



34
35
36
37
38
39
40
41
42
# File 'lib/chef/handler/sns.rb', line 34

def report
  config_check(node)
  if allow_publish(node)
    sns.topics[topic_arn].publish(
      sns_body,
      { :subject => sns_subject }
    )
  end
end