title: Why do I receive this error: `Unable to get object metadata from S3. Check object key, region and/or access permissions.` when I have the permissions
body: <p>I am using AWS SAM to implement an architecture where I have an S3 bucket where files get uploaded and on that event happening a Lambda gets triggered to get the file from the S3 bucket and use AWS Textract to get useful data.</p>
  <p>This whole process worked fine when I directly uploaded the files to the bucket but I have changed that now to happen to a folder with sub-folders for each specific user. It looks like this:</p>
  <p><code>private/region:userIdentity/year/document.extension</code></p>
  <p>I have permissions set for the lambda which allows it to get objects from an S3 bucket. Do I maybe need to set it up also for folder access? I did not have this issue when I uploaded files to S3 bucket directly.</p>
  <p>Here is my permissions:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{
      "Statement": [
          {
              "Action": [
                  "s3:GetObject",
                  "s3:ListBucket",
                  "s3:GetBucketLocation",
                  "s3:GetObjectVersion",
                  "s3:GetLifecycleConfiguration"
              ],
              "Resource": [
                  "arn:aws:s3:::*",
                  "arn:aws:s3:::*/*"
              ],
              "Effect": "Allow"
          }
      ]
  }</code></pre>
  </div>
  </div>
  </p>