Python code to publish a message to AWS SNS

0 votes
Can I write a python code to publish a message to AWS SNS? Can somebody give me the code? Thank you!
Aug 21, 2019 in AWS by Dipti
13,296 views

1 answer to this question.

0 votes

Hey @Dipti, you could use something like this:

import boto3
sns = boto3.client('sns')
# Publish a simple message to the specified SNS topic
response = sns.publish(
    TopicArn='arn:aws:sns:region:0786589:my-topic-arn',   
    Message='Hello World',   
)

# Print out the response
print(response)


Hope it helps!!

If you need to know more about Python, It's recommended to join Python course today.

Thanks!

answered Aug 21, 2019 by Tara

Related Questions In AWS

0 votes
1 answer

How do I publish a message on topic? - AWS SNS

Hey @Harish, follow these steps: On the navigation ...READ MORE

answered Jul 25, 2019 in AWS by Arya
966 views
0 votes
1 answer

Notification to AWS SNS to insert a record insert into Mysql Rds table?

You can achieve "automatic" triggering by AWS Lambda or ...READ MORE

answered Oct 31, 2018 in AWS by Priyaj
• 58,140 points
2,170 views
0 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,140 points
1,355 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,328 views
0 votes
1 answer