Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Hybrid Cloud for Developers

You're reading from   Hybrid Cloud for Developers Develop and deploy cost-effective applications on the AWS and OpenStack platforms with ease

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788830874
Length 280 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Hirway Hirway
Author Profile Icon Hirway
Hirway
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Title Page
Dedication
Packt Upsell
Contributors
Preface
1. Introducing Hybrid Clouds FREE CHAPTER 2. Exploring AWS Cloud 3. Exploring OpenStack Private Cloud 4. Developing AWS Cloud Applications 5. Developing OpenStack Applications 6. Cloud Migration 7. Hybrid Cloud Best Practices 8. Monitoring and Troubleshooting Hybrid Cloud 9. Hybrid Cloud Security 1. Other Books You May Enjoy Index

Developing Amazon SNS applications – Unix


We will use the same boto3 Python package, as it provides classes and functions for implementing the SNS service.

Let's start over by creating an SNS topic.

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 object
sns_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 topic
sns_topic = sns_client.create_topic(Name="packt-pub")
topic_arn = sns_topic['TopicArn']        # fetch...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images