当我尝试在终端上发布到某个主题时:
import boto3
client = boto3.client('sns', region_name="us-east-2")
response = client.publish(
TopicArn="my_topic_arn",
Message="message",
)
我明白了
user/xxxxx is not authorized to perform: SNS:Publish on resource:
如何更改为使用user/yyyyy
?
答案 0 :(得分:1)
user/xxxxx
是您使用默认配置文件配置的AWS Credentials。如果您想使用user/yyyyy
凭据,则需要使用aws configure
或在环境变量AWS_ACCESS_KEY_ID
和AWS_SECRET_ACCESS_KEY