title: Not able to access file in S3Bucket
body: <p>I'm a total newbie in AWS trying to use Textract.
  Right now I have a file in the S3Bucket and I'm trying to process it through the API. I'm using the following code (I'm running it in Python):</p>
  <pre><code># Document
              s3BucketName = &quot;textract-console-us-east-1-057eddde-3f44-45c5-9208-fec27f9f6420&quot;
              documentName = &quot;ok0001_prioridade01.pdf&quot;
  
  
              # Amazon Textract client
              textract = boto3.client('textract',region_name=&quot;us-east-1&quot;,aws_access_key_id=&quot;xxxx&quot;,
                                      aws_secret_access_key=&quot;xxxx&quot;)
  
  
              # Call Amazon Textract
              response = textract.analyze_document(
                  Document={
                      'S3Object': {
                          'Bucket': s3BucketName,
                          'Name': documentName
                      }
                  },
                  FeatureTypes=[&quot;TABLES&quot;])
  </code></pre>
  <p>I'm getting this error:</p>
  <pre><code>botocore.errorfactory.InvalidS3ObjectException: An error occurred (InvalidS3ObjectException) when calling the AnalyzeDocument operation: Unable to get object metadata from S3. Check object key, region and/or access permissions.
  </code></pre>
  <p>Then when I log the console I access the bucket and the file, and when I try to access the file in the above link, I get to this xml error page.</p>
  <pre><code>This XML file does not appear to have any style information associated with it. The document tree is shown below.
  &lt;Error&gt;
  &lt;Code&gt;AccessDenied&lt;/Code&gt;
  &lt;Message&gt;Access Denied&lt;/Message&gt;
  &lt;RequestId&gt;xxxx&lt;/RequestId&gt;
  &lt;HostId&gt;xxxxxxxxxxxxxx&lt;/HostId&gt;
  &lt;/Error&gt;
  </code></pre>
  <p>So I get to wonder why is my access denied. I log back to IAM to see if I've messed something up, however the permissions are applied to my user:</p>
  <p><a href="https://i.stack.imgur.com/AoTye.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AoTye.png" alt="enter image description here" /></a></p>
  <p>What am I missing? Why ain't I able to access the file through the console (and consequently through API)?</p>