Module: Arc::Events
- Defined in:
- lib/architect/events.rb
Class Method Summary collapse
-
.publish(params) ⇒ Object
publish a message to an SNS Topic.
Class Method Details
.publish(params) ⇒ Object
publish a message to an SNS Topic
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/architect/events.rb', line 10 def self.publish(params) name = params[:name] payload = params[:payload] raise ArgumentError, 'missing name' unless name raise ArgumentError, 'missing payload' unless payload arc = Arc.reflect arn = arc['events'][name] sns = Aws::SNS::Client.new sns.publish :topic_arn=> arn, :message=> JSON.generate(payload) end |