title: Cannot pull SQS message from my EC2 instance
body: <p>When I deploy my application to a EC2 instance, it fails to fetch messages from my SQS queue. And instead throws an exception with the status code <code>403 Forbidden, access to the resource {sqs queue} is denied</code>. However, when I run the same code from my local environment my application can fetch messages from the SQS queue. </p>
  
  <p>My application uses the symfony framework and passes pre-configured AWS credentials, for a user who has access to this queue, from the parameters.yml into <code>\Aws\Sqs\SqsClient()</code>. </p>
  
  <p>If on the EC2 instance I run aws configure and configure the aws cli with the same credentials the application can pull messages from the SQS queue. I am concerned here because it is like the aws sdk is overriding the credentials I pass it.</p>
  
  <p>As a example the following code even with hard coded parameters which I have checked are valid credentials, returns a 403 when ran on a EC2 instances. </p>
  
  <pre><code> $sqs = new \Aws\Sqs\SqsClient([
          [
              'key' =&gt; '{my key}',
              'secret' =&gt; '{my secret}'
          ],
          'region' =&gt; 'us-east-1',
          'version' =&gt; 'latest'
      ]);
  
      $response = $sqs-&gt;receiveMessage([
          'QueueUrl' =&gt; 'https://sqs.us-east-1.amazonaws.com/{my account}/{my queue}'
      ]);
  </code></pre>
  
  <p>Does anyone have any suggestions about what may be happening here?</p>