Skip to content

Instantly share code, notes, and snippets.

@daniel-woods
Created October 31, 2018 12:24
Show Gist options
  • Save daniel-woods/38b8348f5163a86eb2dfa8a13699ec33 to your computer and use it in GitHub Desktop.
Save daniel-woods/38b8348f5163a86eb2dfa8a13699ec33 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import boto3
import time
sns = boto3.client("sns")
arn = "TOPIC_ARN"
count = 0
while True:
try:
message = "Message Count: " + str(count)
resp = sns.publish(TopicArn=arn, Message=message)
print(message)
print("MessageID: " + resp['MessageId'])
except Exception as e:
print(e)
finally:
time.sleep(2)
count += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment