Skip to Content
Hybrid Cloud for Developers
book

Hybrid Cloud for Developers

by Manoj Hirway
April 2018
Intermediate to advanced content levelIntermediate to advanced
280 pages
8h 37m
English
Packt Publishing
Content preview from Hybrid Cloud for Developers

Creating a topic

An SNS topic can be created by invoking the create_topic() function of the sns_client object. The result is the Python dictionary that represents the SNS topic. Once an SNS topic is created, AWS automatically assigns a unique ARN to the topic. This ARN can be fetched using the TopicARN key of the SNS topic.

The following Python program demonstrates the creation of an SNS topic:

import boto3# Create an SNS client objectsns_client = boto3.client(    "sns",   # You may have to set the AWS credentials of you haven't already set using AWS CLI   # aws_access_key_id="YOUR ACCES KEY",      # aws_secret_access_key="YOUR SECRET KEY",   # region_name=us-east-1)# Create an SNS topicsns_topic = sns_client.create_topic(Name="packt-pub")topic_arn = ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hybrid Cloud for Architects

Hybrid Cloud for Architects

Alok Shrivastwa
OpenStack: Building a Cloud Environment

OpenStack: Building a Cloud Environment

Alok Shrivastwa, Sunil Sarat, Kevin Jackson, Cody Bunch, Egle Sigler, Tony Campbell

Publisher Resources

ISBN: 9781788830874Supplemental Content