title: AccessDeniedException when calling AnalyzeDocument
body: <p>When calling <a href="https://docs.aws.amazon.com/textract/latest/dg/API_AnalyzeDocument.html" rel="nofollow noreferrer">AnalyzeDocument</a> I receive an <code>Amazon.Textract.Model.AccessDeniedException</code>:</p>
  
  <blockquote>
    <p>Additional information: User: arn:aws:iam::[number]:user/service is not
    authorized to perform: textract:AnalyzeDocument</p>
  </blockquote>
  
  <p>The user is in a group with the AmazonTextractFullAccess policy being attached (<code>arn:aws:iam::aws:policy/AmazonTextractFullAccess</code>):</p>
  
  <p><a href="https://i.stack.imgur.com/pKNbP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pKNbP.png" alt="group membership"></a></p>
  
  <p>(The user's ARN matches the one from my exception, it's just redacted for privacy reasons).</p>
  
  <p>I use the AWS SDK for .NET. Here's the relevant code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>var region = RegionEndpoint.USEast1;
  string bucketName = "my bucket's id";
  
  IAmazonS3 s3Client = new AmazonS3Client(region);
  GetObjectResponse getObjRespone = s3Client.GetObject(bucketName, "inv.jpg");
  using (var ms = new MemoryStream())
  {
      getObjRespone.ResponseStream.CopyTo(ms);
      var textract = new AmazonTextractClient(region);
      var request = new AnalyzeDocumentRequest();
      var document = new Document();
      document.Bytes = ms;
      request.Document = document;
      AnalyzeDocumentResponse response = textract.AnalyzeDocument(request);
  }
  </code></pre>
  
  <p>What am I missing here?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Tried the same with the CLI - this one works. I configured it to use the same user.</p>
  
  <pre><code>./aws textract \
      analyze-document \
      --document '{"S3Object":{"Bucket":"my bucket id","Name":"inv.jpg"}}' \
      --feature-types '["TABLES","FORMS"]'
  </code></pre>