一千萬個為什麽

搜索

如何使用aws sns cli將短信發送到電話號碼?



我使用以下命令。獲取授權錯誤。

aws sns publish --phone-number +91XXXXXXXXXX --message hello

An error occurred (AuthorizationError) when calling the Publish operation: User: arn:aws:XXX::XXXXXXXXXXXX:user/ABC-DEF-SNS is not authorized to perform: SNS:Publish on resource: +91XXXXXXXXXX

其他相關的sns命令正在運行。我還可以通過主題將短信發送到訂閱的號碼。

轉載註明原文: 如何使用aws sns cli將短信發送到電話號碼?

一共有 1 個回答:

很可能您的用戶 arn:aws:XXX :: XXXXXXXXXXXX:user/ABC-DEF-SNS 沒有 sns:Publish API所需的權限。

You can check using the IAM Policy Simulator at https://policysim.aws.amazon.com/

使用策略模擬器在這裏深入解釋 https:/ /docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html