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

Defined Under Namespace

Modules: Config

Constant Summary collapse

VERSION =
'0.2.6'

Constants included from Config

Config::REQUIRED

Instance Method Summary collapse

Methods included from Config

#access_key, #body_template, #config_check, #config_init, #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

#reportObject



34
35
36
37
# File 'lib/chef/handler/sns.rb', line 34

def report
  config_check
  sns.publish(topic_arn, sns_body, sns_subject)
end

#serverObject



39
40
41
# File 'lib/chef/handler/sns.rb', line 39

def server
  @sns.params[:server]
end