I am working with AWS SNS services and completed the initial setup as the AWS documentation. I just needed to test it using aws-cli. So I used the following command to publish a test message to SNS topic from my local PC.
aws sns publish --topic-arn "arn:aws:sns:us-east-1:xxxxxxxxxxx:test-notification-service" --message "Hello, from SNS"
However, I got stuck on the following generic error. It just says Invalid Parameter. I have configured the ~/.aws/credentials as needed.
An error occurred (InvalidParameter) when calling the Publish operation: Invalid parameter: TopicArn
The issue is due to cross-region. You AWS-CLI default region might be different to the region your SNS service location.
Check your AWS-CLI location and make sure you are in the same region as your SNS.
To check your region in AWS CLI use:
aws configure get region
To configure your AWS region you can use the command:
aws configure set region <region-name>
https://docs.aws.amazon.com/cli/latest/reference/configure/set.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With