I am using the following command. Getting Authorization error.

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

Other related sns commands are working. I can also able to send sms through a topic to a subscribed number.

  • I'm voting to close this question as off-topic because this is a question for AWS support and it's in no way related to devops.
    – Tensibai
    Jan 3 '18 at 13:52

Most probably your user arn:aws:XXX::XXXXXXXXXXXX:user/ABC-DEF-SNS does not have the required permissions to the sns:Publish API.

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

using policy simulator is explained in depth here https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html

Not the answer you're looking for? Browse other questions tagged or ask your own question.