Module: RubyAemAws::SNSTopic

Included in:
Component::StackManagerResources
Defined in:
lib/ruby_aem_aws/client/sns_topic.rb

Overview

Mixin for interaction with AWS SNS

Instance Method Summary collapse

Instance Method Details

#publish(topicarn, message) ⇒ Object

Returns Message ID.

Parameters:

  • topicarn

    the ARN of the SNS Topix to publish the message

  • message

    the SNS Message to publish

Returns:

  • Message ID



21
22
23
24
25
26
27
28
# File 'lib/ruby_aem_aws/client/sns_topic.rb', line 21

def publish(topicarn, message)
  client = Aws::SNS::Topic.new(topicarn)
  sns_message = { subject: 'Publish',
                  message: message,
                  message_structure: 'json' }
  publish = client.publish(sns_message)
  publish.message_id
end