mirror of
https://github.com/marcone/teslausb.git
synced 2025-04-18 14:59:07 +00:00
17 lines
602 B
Python
17 lines
602 B
Python
import argparse
|
|
import boto3
|
|
|
|
def send_sns(topic: str, subject: str, message: str):
|
|
sns = boto3.client('sns')
|
|
response = sns.publish(TopicArn=topic, Message=message, Subject=subject)
|
|
return response
|
|
|
|
if __name__== "__main__":
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('-t', '--topic', help='The SNS topic to publish to')
|
|
parser.add_argument('-m', '--message', help='The message to publish')
|
|
parser.add_argument('-s', '--subject', help='The subject of the message to publish')
|
|
args = parser.parse_args()
|
|
|
|
send_sns(args.topic, args.subject, args.message)
|