我是boto和python的新手,试图连接sns。这是我的示例代码:
import boto
sns = boto.connect_sns(aws_access_key_id="my access", aws_secret_access_key="mysecret", region_name='us-east-1')
我收到错误:
Traceback (most recent call last):
File "sns.py", line 5, in <module>
sns=boto.connect_sns(aws_access_key_id="XXXXXXXX",aws_secret_access_key="XXXXXXX",region_name='us-east-1')
AttributeError: 'module' object has no attribute 'connect_sns'
非常感谢在这方面的任何帮助。
这些天,建议您使用boto3
而不是boto
(v2)。这是一些示例代码:
import boto3
client = boto3.client('sns', region_name='ap-southeast-2')
response = client.list_topics()