MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / create_topic

Method create_topic

python/example_code/sns/sns_basics.py:34–48  ·  view source on GitHub ↗

Creates a notification topic. :param name: The name of the topic to create. :return: The newly created topic.

(self, name)

Source from the content-addressed store, hash-verified

32
33 # snippet-start:[python.example_code.sns.CreateTopic]
34 def create_topic(self, name):
35 """
36 Creates a notification topic.
37
38 :param name: The name of the topic to create.
39 :return: The newly created topic.
40 """
41 try:
42 topic = self.sns_resource.create_topic(Name=name)
43 logger.info("Created topic %s with ARN %s.", name, topic.arn)
44 except ClientError:
45 logger.exception("Couldn't create topic %s.", name)
46 raise
47 else:
48 return topic
49
50 # snippet-end:[python.example_code.sns.CreateTopic]
51

Callers 4

usage_demoFunction · 0.95
test_create_topicFunction · 0.95
create_fifo_topicMethod · 0.45

Calls

no outgoing calls

Tested by 1

test_create_topicFunction · 0.76