Created
July 16, 2013 18:59
-
-
Save csexton/6011573 to your computer and use it in GitHub Desktop.
Simple ruby script to post to SQS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# This require the 'aws-sdk' gem to be installed | |
require 'aws/sqs' | |
require 'json' | |
ENV['AWS_ACCESS_KEY_ID']="XXX" | |
ENV['AWS_SECRET_ACCESS_KEY']="XXX" | |
ENV['AWS_SQS_QUEUE']="https://sqs.us-east-1.amazonaws.com/XXX/queue-name" | |
body = { "string" => "data", "array" => [1,2,3] } | |
q = AWS::SQS.new.queues[ENV['AWS_SQS_QUEUE']] | |
q.send_message body.to_json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment