Skip to content

Instantly share code, notes, and snippets.

@tfhartmann
Created February 12, 2014 14:00
Show Gist options
  • Save tfhartmann/8956049 to your computer and use it in GitHub Desktop.
Save tfhartmann/8956049 to your computer and use it in GitHub Desktop.
Example script on how to publish a message to an AWS SNS Queue
#!//opt/boxen/homebrew/bin/python
import boto.sns
import json
REGION = 'us-west-2'
TOPIC = '<ARN>'
URL = '<Body of Message in this example I used a url>'
conn = boto.sns.connect_to_region( REGION )
pub = conn.publish( topic = TOPIC, message = URL )
@vivshri
Copy link

vivshri commented May 23, 2018

Added region name too

`
import boto3

client = boto3.client('sns',, region_name='us-east-1')

response = client.publish(
TopicArn='',
Message=''
)
print("Response: {}".format(response))
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment