SNS 主題

Python 中的 AWS Boto 入門

Maksim Pecherskiy

Data Engineer!

SNS

SNS

Python 中的 AWS Boto 入門

認識 SNS

SNS

Python 中的 AWS Boto 入門

認識 SNS

SNS

Python 中的 AWS Boto 入門

認識 SNS

SNS

Python 中的 AWS Boto 入門

認識 SNS

SNS

Python 中的 AWS Boto 入門

認識 SNS

SNS

Python 中的 AWS Boto 入門

認識 SNS

SNS

Python 中的 AWS Boto 入門

存取 SNS

SNS

Python 中的 AWS Boto 入門

SNS 儀表板

SNS 儀表板

Python 中的 AWS Boto 入門

SNS 主題

SNS 主題

Python 中的 AWS Boto 入門

SNS 主題

SNS 主題

Python 中的 AWS Boto 入門

建立 SNS 主題

sns = boto3.client('sns', 
                   region_name='us-east-1', 
                   aws_access_key_id=AWS_KEY_ID,                   
                   aws_secret_access_key=AWS_SECRET)
Python 中的 AWS Boto 入門

建立 SNS 主題

response = sns.create_topic(Name='city_alerts')
Python 中的 AWS Boto 入門

建立 SNS 主題

建立 SNS 主題

Python 中的 AWS Boto 入門

建立 SNS 主題

topic_arn = response['TopicArn']

或是…捷徑

sns.create_topic(Name='city_alerts')['TopicArn']
Python 中的 AWS Boto 入門

建立 SNS 主題

建立 SNS 主題

Python 中的 AWS Boto 入門

權限

權限

Python 中的 AWS Boto 入門

列出主題

response = sns.list_topics()
Python 中的 AWS Boto 入門

列出主題

列出主題

Python 中的 AWS Boto 入門

刪除主題

sns.delete_topic(TopicArn='arn:aws:sns:us-east-1:320333787981:city_alerts')
Python 中的 AWS Boto 入門

複習

SNS 概觀

Python 中的 AWS Boto 入門

複習

建立 SNS 用戶端

sns = boto3.client('sns', 
                   region_name='us-east-1', 
                   aws_access_key_id=AWS_KEY_ID,                   
                   aws_secret_access_key=AWS_SECRET)

建立主題

response = sns.create_topic(Name='city_alerts')
topic_arn = response['TopicArn']
Python 中的 AWS Boto 入門

複習

列出主題

response = sns.list_topics()
topics = response['Topics']

刪除主題

sns.delete_topic(TopicArn='arn:aws:sns:us-east-1:320333787981:city_alerts')
Python 中的 AWS Boto 入門

一起來練習吧!

Python 中的 AWS Boto 入門

Preparing Video For Download...