I have an SQS queue set up in AWS. I can send and receive messages perfectly using the AWS CLI and my IAM credentials that I set up.
What I would like to do is consume messages from the queue using Camel, configured via Spring. I tried out this example as it is very clear-cut and to the point:
https://github.com/christian-posta/camel-sqs-example
However, I get the following exception:
com.amazonaws.AmazonServiceException: Status Code: 403, AWS Service: AmazonSQS,
AWS Request ID: 115057f8-3c4f-5ec6-8fe9-18ea097b2730, AWS Error Code:
InvalidClientTokenId, AWS Error Message: The security token included in the
request is invalid.
Amazon provides the most unhelpful documentation:
InvalidClientTokenId
The X.509 certificate or AWS access key ID provided does not exist in our records.
HTTP Status Code: 403
I have double-checked that I am using the exact same IAM credentials as I used through the CLI and that IAM user has a policy allowing read/write access to the queue. I have also toyed around with sending the additional URL params accessKey, secretKey, amazonSQSEndpoint and region as documented by Camel.
Why is Amazon saying that the access key is invalid or doesn't exist in their records and how can I fix my request?