title: How to grant EC2 access to SQS
body: <p>The docs are very confusing to me. I have read through the SQS access docs. But what really throws me is this page: <a href="http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-sqs.html" rel="nofollow">http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-sqs.html</a></p>
  
  <blockquote>
    <p>You can provide your credential profile like in the preceding example,
    specify your access keys directly (via key and secret), <strong>or you can
    choose to omit any credential information if you are using AWS
    Identity and Access Management (IAM) roles for EC2 instances</strong> or
    credentials sourced from the AWS_ACCESS_KEY_ID and
    AWS_SECRET_ACCESS_KEY environment variables.</p>
  </blockquote>
  
  <p>1) Regarding what I have bolded, how is that possible? I cannot find steps whereas you are able to grant EC2 instances access to SQS using IAM roles. This is very confusing.</p>
  
  <p>2) Where would the aforementioned environment variables be placed? And where would you get the key and secret from?</p>
  
  <p>Can someone help clarify?</p>