Created
October 31, 2018 12:24
-
-
Save daniel-woods/38b8348f5163a86eb2dfa8a13699ec33 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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