AWS SDK for Ruby
Developer Guide

Sending a Message to All Amazon SNS Topic Subscribers

The following example sends the message "Hello!" to all subscribers to the Amazon SNS topic with the ARN arn:aws:sns:us-west-2:123456789:MyGroovyTopic.

require 'aws-sdk-sns' # v2: require 'aws-sdk' sns = Aws::SNS::Resource.new(region: 'us-west-2') topic = sns.topic('arn:aws:sns:us-west-2:123456789:MyGroovyTopic') topic.publish({ message: 'Hello!' })