I am trying to send messages to an SQS queue. For local environment I am setting up the AmazonSQS object like below
amazonSQS =
AmazonSQSClientBuilder.standard()
.withCredentials(
new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region))
.build();
For my development environment I am setting up like below
amazonSQS = AmazonSQSClientBuilder.defaultClient();
The tests run fine locally but in my dev environment, I am getting the below error:
com.amazonaws.services.sqs.model.AmazonSQSException: Access to the resource https://sqs.us-east-1.amazonaws.com/2092384092384/error-handler-queue is denied. (Service: AmazonSQS; Status Code: 403; Error Code: AccessDenied; Request ID: 7bc7e074-a36a-544d-9489-bbe66133f0a8; Proxy: null)
What could be the issue ? Any help is appreciated